-----------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\C
> h6-Polarization.log
  log type:  text
 opened on:  26 Jul 2023, 19:30:47

.  
.         ******************************
.         **** Set directory, seed *****
.         ******************************
.                 set more off 

.                 set matsize 1000
set matsize ignored.
    Matrix sizes are no longer limited by c(matsize) in modern Statas.  Matrix
    sizes are now limited by edition of Stata.  See limits for more details.

.                 global seed ="984353"

.                 set scheme plotplain

.                 cd "$dir"
C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction

.                 
.         *******************
.         **** Load data ****
.         *******************
.                 use pers-use,clear

.                 egen c=count(year) if e(sample)==1,by(lid)              
(2,392 missing values generated)

.                 gen election = v2xel_elecparl==1 | v2xel_elecpres==1

.                 gen time = year-1990

.                 gen lowerprop = v2elparlel==1 if v2elparlel~=.

.                 gen lowermix = v2elparlel==2 if v2elparlel~=.

.                 gen lowermajor = v2elparlel==0 if v2elparlel~=.

.                                 
.                 ** Leader time in power **
.                 gen t = 1 if year==min  
(1,814 missing values generated)

.                 replace t = year-current_leader_start_year if year==1991 & year~=
> .
(30 real changes made)

.                 sort lid year

.                 bysort lid: replace t=t[_n-1]+1 if lid==lid[_n-1] & t==.
(1,770 real changes made)

.                 sum t

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
           t |      2,350    3.659149    2.650331          1         15

.                 gen lt =ln(t+1)
(42 missing values generated)

.         
.                 ** Differenced polarization **
.                 tsset lid year

Panel variable: lid (unbalanced)
 Time variable: year, 1991 to 2020
         Delta: 1 unit

.                 gen dpolar = d.polar
(616 missing values generated)

. 
.                 ** Initial values **
.                 local var = "polarization"

.                 foreach v of local var {
  2.                          qui gen o`v'=(l1`v'+ l2`v')/2 if minyr==year
  3.                          qui replace o`v'=(l1`v')  if minyr==year & o`v'==.
  4.                          qui egen i`v'=max(o`v'),by(lid)
  5.                 }               

. 
.                 ** Standardize outcomes **
.                 local var = "polarization l1polar"

.                 foreach v of local var {
  2.                          qui sum `v'
  3.                          qui replace `v'=`v' +abs(r(mean))
  4.                          qui sum `v'
  5.                          qui replace `v'=`v'/r(sd)
  6.                 }       

.                 sum polarization l1polar

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
polarization |      2,361   -1.78e-09           1  -2.500193   3.478894
l1polariza~n |      2,361    1.36e-08           1   -2.50604   2.765606

.                 swilk polarization l1polar

                   Shapiro–Wilk W test for normal data

    Variable |        Obs       W           V         z       Prob>z
-------------+------------------------------------------------------
polarization |      2,361    0.98766     17.014     7.252    0.00000
l1polariza~n |      2,361    0.98657     18.516     7.469    0.00000

Note: The normal approximation to the sampling distribution of W'
      is valid for 4<=n<=2000.

.                 egen maxyr  =max(year),by(lid)

.                 gen devpolar = polar-ipolar if year==maxyr
(1,825 missing values generated)

.                 
.                 ** Attacks on the State **
.                 gen ojud = l1v2x_jucon if year==min
(1,815 missing values generated)

.                 egen ijud = max(ojud),by(lid)
(55 missing values generated)

.                  alpha v2jupurge v2jupoatck v2jupack,item std gen(attack)

Test scale = mean(standardized items)

                                                            Average
                             Item-test     Item-rest       interitem
Item         |  Obs  Sign   correlation   correlation     correlation     alpha
-------------+-----------------------------------------------------------------
v2jupurge    | 2392    +       0.8549        0.6559          0.4472      0.6180
v2jupoatck   | 2392    +       0.8209        0.5895          0.5314      0.6940
v2jupack     | 2392    +       0.7994        0.5497          0.5845      0.7378
-------------+-----------------------------------------------------------------
Test scale   |                                               0.5210      0.7654
-------------------------------------------------------------------------------

.                  replace attack = attack*-1
(2,392 real changes made)

.                  qui sum attack

.                  replace attack = (attack +abs(r(min)))/(r(max) + abs(r(min)))
(2,392 real changes made)

.                  sum attack

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      attack |      2,392    .2656246    .1535195          0          1

.                  hist attack
(bin=33, start=0, width=.03030303)

.                 
.                 ** Set globals **
.                 global d="persparty"

.                 global c = "ld ivdem2 l1polar election" 

.                 gen ivdem2=ivdem*10

.                 
.                 ** Check serial correlation **
.                 xtset cowcode year

Panel variable: cowcode (unbalanced)
 Time variable: year, 1991 to 2020, but with gaps
         Delta: 1 unit

.                 qui reg polar $d ld ivdem ipolar election

.                 abar,lags(4)
Arellano-Bond test for AR(1): z =  35.51  Pr > z = 0.0000
Arellano-Bond test for AR(2): z =  24.70  Pr > z = 0.0000
Arellano-Bond test for AR(3): z =  15.36  Pr > z = 0.0000
Arellano-Bond test for AR(4): z =   9.19  Pr > z = 0.0000

.                 qui reg dpolar $d ld ivdem ipolar election

.                 abar,lags(4)
Arellano-Bond test for AR(1): z =   0.65  Pr > z = 0.5157
Arellano-Bond test for AR(2): z =  -0.45  Pr > z = 0.6528
Arellano-Bond test for AR(3): z =   0.94  Pr > z = 0.3481
Arellano-Bond test for AR(4): z =   0.56  Pr > z = 0.5778

.                 qui reg polar $d $c time,cluster(lid)

.                 abar,lags(4)
Arellano-Bond test for AR(1): z =   0.41  Pr > z = 0.6836
Arellano-Bond test for AR(2): z =  -0.45  Pr > z = 0.6544
Arellano-Bond test for AR(3): z =  -0.82  Pr > z = 0.4106
Arellano-Bond test for AR(4): z =   0.55  Pr > z = 0.5815

.                 
.                 ** Polarization cases **
.                 twoway (line polar year if country=="Benin",sort) ///
>                         (line polar year if country=="United States",sort) ///
>                         (line polar year if country=="Venezuela",sort legend(lab(
> 1 "Benin") ///
>                         lab(2 "United States")lab(3 "Venezuela")pos(5)ring(0)col(
> 1)) ///
>                         xtit(Year)ytit("Polarization (scaled)"))

.                 gr export "$dir\golden\Ch6-Polarization-Cases.pdf",as(pdf)replace
>  
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\C
    > h6-Polarization-Cases.pdf saved as PDF format

. 
.                 ** Polarization tests **
.                 reg polar $d ld l1polar,cluster(lid)

Linear regression                               Number of obs     =      2,359
                                                F(3, 584)         =   15160.02
                                                Prob > F          =     0.0000
                                                R-squared         =     0.9608
                                                Root MSE          =     .19808

                                    (Std. err. adjusted for 585 clusters in lid)
--------------------------------------------------------------------------------
               |               Robust
  polarization | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0582241   .0215312     2.70   0.007     .0159361     .100512
            ld |   .0167745   .0046284     3.62   0.000     .0076842    .0258648
l1polarization |   .9816934   .0048978   200.44   0.000     .9720739    .9913129
         _cons |  -.0796462   .0224039    -3.56   0.000    -.1236482   -.0356442
--------------------------------------------------------------------------------

.                 est store polar0

.                 reg polar $d $c time,cluster(lid)

Linear regression                               Number of obs     =      2,359
                                                F(6, 584)         =    8205.72
                                                Prob > F          =     0.0000
                                                R-squared         =     0.9613
                                                Root MSE          =     .19688

                                    (Std. err. adjusted for 585 clusters in lid)
--------------------------------------------------------------------------------
               |               Robust
  polarization | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0503523   .0215446     2.34   0.020     .0080379    .0926667
            ld |   .0115227   .0051506     2.24   0.026     .0014066    .0216387
        ivdem2 |  -.0003956    .003583    -0.11   0.912    -.0074328    .0066416
l1polarization |    .977678   .0052807   185.14   0.000     .9673064    .9880495
      election |   .0365075   .0090384     4.04   0.000     .0187558    .0542592
          time |   .0019259   .0004999     3.85   0.000     .0009441    .0029076
         _cons |  -.0999562    .031139    -3.21   0.001    -.1611143   -.0387982
--------------------------------------------------------------------------------

.                 est store polar1

.                 reg polar $d $c time pres lowerprop lowermix,cluster(lid)

Linear regression                               Number of obs     =      2,359
                                                F(9, 584)         =    5940.51
                                                Prob > F          =     0.0000
                                                R-squared         =     0.9615
                                                Root MSE          =      .1967

                                    (Std. err. adjusted for 585 clusters in lid)
--------------------------------------------------------------------------------
               |               Robust
  polarization | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0436431   .0216034     2.02   0.044     .0012133    .0860729
            ld |   .0127001   .0053892     2.36   0.019     .0021155    .0232847
        ivdem2 |     .00102   .0037588     0.27   0.786    -.0063623    .0084024
l1polarization |   .9769675    .005428   179.99   0.000     .9663067    .9876284
      election |   .0366039   .0090658     4.04   0.000     .0187983    .0544095
          time |   .0018413   .0005104     3.61   0.000     .0008389    .0028436
          pres |   .0218059   .0093955     2.32   0.021     .0033529    .0402589
     lowerprop |  -.0073007   .0108198    -0.67   0.500    -.0285512    .0139497
      lowermix |   .0025646   .0144401     0.18   0.859    -.0257963    .0309255
         _cons |   -.116376   .0317963    -3.66   0.000    -.1788251    -.053927
--------------------------------------------------------------------------------

.                 est store polar2 

.                  * Dynamic panel model *
.                 reghdfe polarization $d $c,a(cowcode year)cluster(lid)
(dropped 3 singleton observations)
(MWFE estimator converged in 6 iterations)

HDFE Linear regression                            Number of obs   =      2,356
Absorbing 2 HDFE groups                           F(   5,    581) =     521.42
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9653
                                                  Adj R-squared   =     0.9632
                                                  Within R-sq.    =     0.7522
Number of clusters (lid)     =        582         Root MSE        =     0.1916

                                    (Std. err. adjusted for 582 clusters in lid)
--------------------------------------------------------------------------------
               |               Robust
  polarization | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0679264   .0347868     1.95   0.051    -.0003968    .1362496
            ld |   .0248238   .0124132     2.00   0.046     .0004435    .0492041
        ivdem2 |  -.0176139   .0078909    -2.23   0.026    -.0331121   -.0021157
l1polarization |   .8616626   .0189578    45.45   0.000     .8244284    .8988967
      election |   .0353759   .0093657     3.78   0.000     .0169813    .0537706
         _cons |   .0048923    .069297     0.07   0.944    -.1312108    .1409954
--------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
     cowcode |       102           0         102     |
        year |        30           1          29     |
-----------------------------------------------------+

.                 est store polar3

.                 xtreg polarization $d $c i.year,cluster(cowcode)fe

Fixed-effects (within) regression               Number of obs     =      2,359
Group variable: cowcode                         Number of groups  =        105

R-squared:                                      Obs per group:
     Within  = 0.7876                                         min =          1
     Between = 0.9937                                         avg =       22.5
     Overall = 0.9605                                         max =         30

                                                F(34, 104)        =     206.78
corr(u_i, Xb) = 0.8239                          Prob > F          =     0.0000

                                (Std. err. adjusted for 105 clusters in cowcode)
--------------------------------------------------------------------------------
               |               Robust
  polarization | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0679264   .0393952     1.72   0.088    -.0101958    .1460486
            ld |   .0248238   .0137916     1.80   0.075    -.0025255    .0521731
        ivdem2 |  -.0176139   .0082236    -2.14   0.035    -.0339216   -.0013063
l1polarization |   .8616626   .0216257    39.84   0.000      .818778    .9045471
      election |   .0353759   .0090209     3.92   0.000     .0174871    .0532647
               |
          year |
         1992  |   .0236582   .0312662     0.76   0.451    -.0383438    .0856603
         1993  |  -.0118574   .0258108    -0.46   0.647    -.0630412    .0393264
         1994  |   .0001681   .0147691     0.01   0.991    -.0291197    .0294559
         1995  |   .0147299   .0236618     0.62   0.535    -.0321924    .0616521
         1996  |  -.0211099   .0197828    -1.07   0.288      -.06034    .0181201
         1997  |  -.0061923   .0302383    -0.20   0.838    -.0661559    .0537714
         1998  |  -.0117746   .0203911    -0.58   0.565     -.052211    .0286617
         1999  |   .0196955   .0229692     0.86   0.393    -.0258533    .0652443
         2000  |    .022908   .0337731     0.68   0.499    -.0440654    .0898814
         2001  |    .027447    .019466     1.41   0.162    -.0111548    .0660487
         2002  |   .0220115   .0243354     0.90   0.368    -.0262466    .0702695
         2003  |   .0135361   .0238113     0.57   0.571    -.0336825    .0607547
         2004  |   .0187988     .02457     0.77   0.446    -.0299244     .067522
         2005  |   .0439986   .0297244     1.48   0.142    -.0149461    .1029433
         2006  |   .0454828     .02512     1.81   0.073     -.004331    .0952967
         2007  |   .0587242   .0248199     2.37   0.020     .0095053     .107943
         2008  |   .0468011   .0306616     1.53   0.130     -.014002    .1076043
         2009  |   .0220479    .028807     0.77   0.446    -.0350775    .0791734
         2010  |    .068671   .0337877     2.03   0.045     .0016688    .1356732
         2011  |   .0265592   .0249358     1.07   0.289    -.0228894    .0760078
         2012  |   .0623161   .0277005     2.25   0.027     .0073849    .1172473
         2013  |   .0574872   .0270851     2.12   0.036     .0037763     .111198
         2014  |   .0553026   .0291131     1.90   0.060    -.0024299     .113035
         2015  |     .06683   .0267257     2.50   0.014     .0138319    .1198281
         2016  |   .1193646   .0280946     4.25   0.000     .0636521    .1750772
         2017  |   .1064005   .0280348     3.80   0.000     .0508064    .1619946
         2018  |   .0857477   .0261365     3.28   0.001     .0339181    .1375773
         2019  |   .0999969   .0300424     3.33   0.001     .0404216    .1595721
         2020  |   .0988879   .0413099     2.39   0.018     .0169689    .1808069
               |
         _cons |  -.0374347   .0725487    -0.52   0.607    -.1813015    .1064322
---------------+----------------------------------------------------------------
       sigma_u |  .13447596
       sigma_e |  .19158793
           rho |  .33005797   (fraction of variance due to u_i)
--------------------------------------------------------------------------------

.                 lincom $d

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0679264   .0393952     1.72   0.088    -.0101958    .1460486
------------------------------------------------------------------------------

.                 predict e_residuals_1, e
(33 missing values generated)

.                 xtistest e_res, lags(1)

Inoue and Solon (2006) LM-test on variables e_residuals_1
Panelvar: cowcode
Timevar: year
p (lags): 1
-----------------------------------------------------------------------------------
> ---+
           Variable           |  IS-stat    p-value   |      N    maxT |   balance?
>    |
------------------------------+-----------------------+----------------+-----------
> ---|
        e_residuals_1         +   41.15      0.067    +    105      30 +     gaps  
>    |
-----------------------------------------------------------------------------------
> ---+
 Notes: Under H0, LM ~ chi2(p*T-p(p+1)/2)
    H0: No auto-correlation of any order.
    Ha: Auto-correlation up to order 1.

.                 xtistest e_res, lags(2)

Inoue and Solon (2006) LM-test on variables e_residuals_1
Panelvar: cowcode
Timevar: year
p (lags): 2
-----------------------------------------------------------------------------------
> ---+
           Variable           |  IS-stat    p-value   |      N    maxT |   balance?
>    |
------------------------------+-----------------------+----------------+-----------
> ---|
        e_residuals_1         +   57.61      0.452    +    105      30 +     gaps  
>    |
-----------------------------------------------------------------------------------
> ---+
 Notes: Under H0, LM ~ chi2(p*T-p(p+1)/2)
    H0: No auto-correlation of any order.
    Ha: Auto-correlation up to order 2.

.                 drop e_res

.                  * Dynamic panel model post-1st year *
.                 reghdfe polarization $d $c if year>min,a(cowcode year)cluster(lid
> )      
(dropped 4 singleton observations)
(MWFE estimator converged in 6 iterations)

HDFE Linear regression                            Number of obs   =      1,786
Absorbing 2 HDFE groups                           F(   5,    470) =     427.66
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9698
                                                  Adj R-squared   =     0.9674
                                                  Within R-sq.    =     0.7719
Number of clusters (lid)     =        471         Root MSE        =     0.1805

                                    (Std. err. adjusted for 471 clusters in lid)
--------------------------------------------------------------------------------
               |               Robust
  polarization | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0942746   .0366078     2.58   0.010     .0223395    .1662098
            ld |   .0296054    .014843     1.99   0.047     .0004386    .0587722
        ivdem2 |  -.0096419   .0083614    -1.15   0.249    -.0260722    .0067884
l1polarization |   .8813191   .0205043    42.98   0.000     .8410277    .9216106
      election |   .0352045   .0097922     3.60   0.000     .0159627    .0544463
         _cons |  -.0795269   .0740617    -1.07   0.283    -.2250598    .0660061
--------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
     cowcode |        99           0          99     |
        year |        30           1          29     |
-----------------------------------------------------+

.                 est store polar4

.                  * Dynamic panel model post-1st year with 4 lags *
.                 reghdfe polarization $d $c l2polar l3polar l4polar,a(cowcode year
> )cluster(lid)  
(dropped 1 singleton observations)
(MWFE estimator converged in 6 iterations)

HDFE Linear regression                            Number of obs   =      2,326
Absorbing 2 HDFE groups                           F(   8,    574) =     340.53
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9657
                                                  Adj R-squared   =     0.9635
                                                  Within R-sq.    =     0.7483
Number of clusters (lid)     =        575         Root MSE        =     0.1908

                                    (Std. err. adjusted for 575 clusters in lid)
--------------------------------------------------------------------------------
               |               Robust
  polarization | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0650618   .0347637     1.87   0.062    -.0032179    .1333414
            ld |   .0224729   .0124801     1.80   0.072    -.0020393     .046985
        ivdem2 |  -.0130557   .0083637    -1.56   0.119     -.029483    .0033715
l1polarization |   .8927695   .0387365    23.05   0.000      .816687    .9688521
      election |    .034913   .0094503     3.69   0.000     .0163516    .0534743
l2polarization |  -.0206318    .024361    -0.85   0.397    -.0684793    .0272158
l3polarization |  -.0054625    .022742    -0.24   0.810    -.0501303    .0392052
l4polarization |   .0023944   .0188685     0.13   0.899    -.0346654    .0394541
         _cons |  -.0296353   .0723073    -0.41   0.682    -.1716545    .1123839
--------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
     cowcode |       102           0         102     |
        year |        30           1          29     |
-----------------------------------------------------+

.                 est store polar5        

.                  * Baseline & dynamic panel + confounders *
.                 local var = "lnparty i_pop ipi v2pariglef"

.                 foreach v of local var {
  2.                         qui reg polar `v' $d $c time,cluster(lid)
  3.                         lincom $d
  4.                         qui reghdfe polarization `v' $d $c time,a(cowcode)clus
> ter(lid)
  5.                         lincom $d
  6.                 }

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0798714   .0276893     2.88   0.004     .0254887    .1342541
------------------------------------------------------------------------------

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0923568   .0390409     2.37   0.018     .0156783    .1690353
------------------------------------------------------------------------------

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0448048    .022212     2.02   0.044     .0011749    .0884348
------------------------------------------------------------------------------

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .062267   .0348451     1.79   0.074    -.0061785    .1307126
------------------------------------------------------------------------------

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0511885    .023187     2.21   0.028     .0056457    .0967313
------------------------------------------------------------------------------

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0703635   .0347752     2.02   0.044     .0020587    .1386683
------------------------------------------------------------------------------

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0525724   .0225155     2.33   0.020     .0083432    .0968016
------------------------------------------------------------------------------

 ( 1)  persparty = 0

------------------------------------------------------------------------------
polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0748843   .0362244     2.07   0.039     .0037249    .1460437
------------------------------------------------------------------------------

.                  
.                 
.                 * Plot lag DVs *
.                 label var persparty "Party personalism"

.                 label var ld "Democracy age"

.                 label var ivdem2 "Initial democracy"

.                 label var election "Election year"

.                 label var time "Time trend"

.                 label var pres `""Presidential  " "(Parliamentary)""'

.                 label var lowermix `""Mixed      " "(Majoritarian)""'

.                 label var lowerprop `""Proportional " "(Majoritarian)""'

.                 coefplot(polar0, msymbol(P))(polar1, msymbol(S))(polar2, msymbol(
> T)) (polar3, msymbol(D)), ///
>                         drop(_cons l1polarization time) grid(glcolor(gs15))xline(
> 0,lpattern(dash)) xlab(-.05(.05).15) ///
>                         xtitle(Coefficient estimates,size(small)) order($d  )leve
> l(95 90) title("Yearly effect", ///
>                         size(medium)height(6))xsize(2) ysize(3.5)mlabel format(%9
> .2g) ///
>                         mlabsize(vsmall)mlabposition(2)mlabgap(*.75) ///
>                         legend(lab(3 "No covariates")lab(6 "Baseline") lab(9 "Ins
> titutions")  lab(12 "Dynamic panel")  ///
>                         order(3 6  9 12)size(vsmall)pos(6)col(2)ring(1))saving(h1
> .gph,replace)  
(note:  named style P not found in class symbol, default attributes used)
(file h1.gph not found)
file h1.gph saved

.                 
.                 reg devpolar $d ld ipolar,cluster(lid)

Linear regression                               Number of obs     =        567
                                                F(3, 566)         =     143.83
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4238
                                                Root MSE          =     .41155

                                   (Std. err. adjusted for 567 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
     devpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .2601199   .0977064     2.66   0.008     .0682084    .4520314
           ld |   .0962969   .0215296     4.47   0.000     .0540091    .1385846
ipolarization |  -.2521188   .0158127   -15.94   0.000    -.2831776     -.22106
        _cons |  -.0501375   .1025879    -0.49   0.625     -.251637    .1513619
-------------------------------------------------------------------------------

.                 est store tp0

.                 reg devpolar $d ld ipolar ivdem2 election time ,cluster(lid)

Linear regression                               Number of obs     =        567
                                                F(6, 566)         =      80.52
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4472
                                                Root MSE          =     .40419

                                   (Std. err. adjusted for 567 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
     devpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .2210461   .0937394     2.36   0.019     .0369266    .4051656
           ld |   .0792257   .0259519     3.05   0.002     .0282518    .1301995
ipolarization |  -.2706057   .0164482   -16.45   0.000    -.3029126   -.2382988
       ivdem2 |  -.0177035   .0149216    -1.19   0.236     -.047012    .0116051
     election |   .0198314   .0355555     0.56   0.577    -.0500054    .0896683
         time |   .0090666   .0016961     5.35   0.000     .0057352    .0123979
        _cons |  -.0325743   .1137173    -0.29   0.775    -.2559339    .1907852
-------------------------------------------------------------------------------

.                 est store tp1

.                 reg devpolar $d ld ipolar ivdem2 election  time pres lowerprop lo
> wermix,cluster(lid)

Linear regression                               Number of obs     =        567
                                                F(9, 566)         =      56.87
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4561
                                                Root MSE          =     .40199

                                   (Std. err. adjusted for 567 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
     devpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .1930841   .0925024     2.09   0.037     .0113942    .3747741
           ld |   .0811526    .027379     2.96   0.003     .0273757    .1349295
ipolarization |  -.2706769   .0168366   -16.08   0.000    -.3037467   -.2376071
       ivdem2 |  -.0106503   .0160377    -0.66   0.507     -.042151    .0208505
     election |   .0038057   .0362799     0.10   0.916    -.0674539    .0750654
         time |   .0083224   .0017381     4.79   0.000     .0049085    .0117363
         pres |   .0983723   .0382479     2.57   0.010     .0232473    .1734974
    lowerprop |  -.0150807   .0470451    -0.32   0.749     -.107485    .0773236
     lowermix |   .0424565   .0564171     0.75   0.452     -.068356    .1532689
        _cons |  -.0938524   .1155808    -0.81   0.417     -.320872    .1331672
-------------------------------------------------------------------------------

.                 est store tp2

.                 reghdfe devpolar $d ld ivdem2 election ipolar,a(cowcode year)clus
> ter(lid)
(dropped 11 singleton observations)
(MWFE estimator converged in 9 iterations)

HDFE Linear regression                            Number of obs   =        556
Absorbing 2 HDFE groups                           F(   5,    431) =      24.82
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.6394
                                                  Adj R-squared   =     0.5357
                                                  Within R-sq.    =     0.3653
Number of clusters (lid)     =        556         Root MSE        =     0.3686

                                   (Std. err. adjusted for 556 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
     devpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .3018715   .1264397     2.39   0.017     .0533563    .5503866
           ld |   .1309919    .064217     2.04   0.042     .0047746    .2572093
       ivdem2 |  -.0598312    .030436    -1.97   0.050    -.1196527   -9.61e-06
     election |   .0135508   .0376117     0.36   0.719    -.0603743     .087476
ipolarization |  -.5319314   .0524979   -10.13   0.000    -.6351152   -.4287477
        _cons |   .1154754   .2889848     0.40   0.690    -.4525194    .6834703
-------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
     cowcode |        91           0          91     |
        year |        30           1          29     |
-----------------------------------------------------+

.                 est store tp3

.                 coefplot(tp0, msymbol(P))(tp1, msymbol(S))(tp2, msymbol(T)) (tp3,
>  msymbol(D)), ///
>                         drop(_cons ipolarization time) grid(glcolor(gs15))xline(0
> ,lpattern(dash)) xlab(-.15(.15).45) ///
>                         xtitle(Coefficient estimates,size(small)) order($d  )leve
> l(95 90) title("Total effect", ///
>                         size(medium)height(6))xsize(2) ysize(3.5)mlabel format(%9
> .2g) ///
>                         mlabsize(vsmall)mlabposition(2)mlabgap(*.75) ///
>                         legend(lab(3 "No covariates")lab(6 "Baseline") lab(9 "Ins
> titutions")  lab(12 "Dynamic panel")  ///
>                         order(3 6  9 12)size(vsmall)pos(6)col(2)ring(1))saving(h2
> .gph,replace)  
(note:  named style P not found in class symbol, default attributes used)
(file h2.gph not found)
file h2.gph saved

.                 gr combine h1.gph h2.gph,xsize(5)tit("            Party personali
> sm increases polarization")
(note:  named style P not found in class symbol, default attributes used)
(note:  named style P not found in class symbol, default attributes used)

.                 gr export "$dir\golden\Ch6-Macro-Polarization-estimates.pdf",as(p
> df)replace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\C
    > h6-Macro-Polarization-estimates.pdf saved as PDF format

.         
.                 ** IFE **
.                 regife polar persparty election ld ivdem ipolar,ife(cowcode year,
> 1)a(cowcode year)vce(cluster lid)

REGIFE                                            Number of obs   =       2302
Panel structure: cowcode, year                    F(   5,    566) =       9.08
Factor dimension: 1                               Prob > F        =     0.0000
Converged: true                                   Root MSE        =     0.2373
                                                  Iterations      =        136
-------------------------------------------------------------------------------
 polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .1163833   .0694927     1.67   0.095    -.0201118    .2528784
     election |   .0275009   .0100176     2.75   0.006     .0078247    .0471772
           ld |   .0043201   .0359264     0.12   0.904    -.0662453    .0748854
        ivdem |  -.5216314   .2151453    -2.42   0.016     -.944212   -.0990507
ipolarization |    .202225   .0477716     4.23   0.000     .1083937    .2960564
        _cons |   .3832697   .1648131     2.33   0.020     .0595497    .7069896
-------------------------------------------------------------------------------

.                 regife polar persparty election ld ivdem ipolar,ife(cowcode year,
> 2)a(cowcode year)vce(cluster lid)
The algorithm did not converge : convergence error is 1.1e-08 (tolerance 1.0e-09)
Allow for more iterations with the option maxiter

REGIFE                                            Number of obs   =       2302
Panel structure: cowcode, year                    F(   5,    566) =       4.44
Factor dimension: 2                               Prob > F        =     0.0006
Converged: false                                  Root MSE        =     0.2032
                                                  Iterations      =      10000
-------------------------------------------------------------------------------
 polarization | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .1137924   .0637228     1.79   0.075    -.0113696    .2389544
     election |   .0254251   .0089182     2.85   0.005     .0079083    .0429419
           ld |  -.0915614   .0431865    -2.12   0.034    -.1763867   -.0067361
        ivdem |  -.5346015   .2869193    -1.86   0.063    -1.098158    .0289551
ipolarization |   .0153644   .0450917     0.34   0.733    -.0732031     .103932
        _cons |   .5981217   .2215294     2.70   0.007     .1630016    1.033242
-------------------------------------------------------------------------------

.                 regife dpolar persparty election ld ivdem ipolar,ife(cowcode year
> ,1)a(cowcode year)vce(cluster lid)
The algorithm did not converge : convergence error is 2.4e-07 (tolerance 1.0e-09)
Allow for more iterations with the option maxiter

REGIFE                                            Number of obs   =       1732
Panel structure: cowcode, year                    F(   5,    455) =       6.87
Factor dimension: 1                               Prob > F        =     0.0000
Converged: false                                  Root MSE        =     0.2032
                                                  Iterations      =      10000
-------------------------------------------------------------------------------
       dpolar | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .0445401   .0334196     1.33   0.183    -.0211358    .1102159
     election |   .0516703   .0129989     3.97   0.000      .026125    .0772157
           ld |   .0071985   .0160018     0.45   0.653     -.024248     .038645
        ivdem |   .0000638   .0866924     0.00   0.999    -.1703033     .170431
ipolarization |  -.0732688   .0211755    -3.46   0.001    -.1148827    -.031655
        _cons |  -.0730212   .0602292    -1.21   0.226    -.1913832    .0453408
-------------------------------------------------------------------------------

.                 regife dpolar persparty election ld ivdem ipolar,ife(cowcode year
> ,2)a(cowcode year)vce(cluster lid)             
The algorithm did not converge : convergence error is 2.3e-07 (tolerance 1.0e-09)
Allow for more iterations with the option maxiter

REGIFE                                            Number of obs   =       1732
Panel structure: cowcode, year                    F(   5,    455) =       5.10
Factor dimension: 2                               Prob > F        =     0.0001
Converged: false                                  Root MSE        =     0.1867
                                                  Iterations      =      10000
-------------------------------------------------------------------------------
       dpolar | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .0676588   .0325326     2.08   0.038      .003726    .1315917
     election |    .035145   .0125194     2.81   0.005     .0105419    .0597481
           ld |   .0201448   .0154195     1.31   0.192    -.0101574    .0504471
        ivdem |  -.0547499   .0753791    -0.73   0.468    -.2028842    .0933844
ipolarization |  -.0555039   .0174023    -3.19   0.002    -.0897028   -.0213049
        _cons |    -.07166   .0580367    -1.23   0.218    -.1857133    .0423933
-------------------------------------------------------------------------------

.                 
.                 ** Mediate by attacks on the state **
.                 gen t0=.
(2,392 missing values generated)

.                 gen tlo=.
(2,392 missing values generated)

.                 gen thi=.
(2,392 missing values generated)

.                 gen z0=.
(2,392 missing values generated)

.                 gen zlo=.
(2,392 missing values generated)

.                 gen zhi=.
(2,392 missing values generated)

.                 gen n=_n

.                                 * Yearly change *
.                 medeff (regress attack $d ld ivdem l1polar election time)  ///
>                         (regress dpolar $d attack ld ivdem l1polar election time)
> , ///
>                         mediate(attack)treat($d)sims(1000)vce(cluster lid)
Using 0 and 1 as treatment values

Linear regression                               Number of obs     =      1,776
                                                F(6, 471)         =      47.11
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4880
                                                Root MSE          =     .10971

                                    (Std. err. adjusted for 472 clusters in lid)
--------------------------------------------------------------------------------
               |               Robust
        attack | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0760339   .0363443     2.09   0.037     .0046169    .1474508
            ld |  -.0087889   .0080079    -1.10   0.273    -.0245244    .0069467
         ivdem |  -.4073622    .052986    -7.69   0.000    -.5114804   -.3032441
l1polarization |   .0401755   .0079841     5.03   0.000     .0244866    .0558643
      election |   .0077819   .0038869     2.00   0.046     .0001441    .0154198
          time |  -.0002041   .0006766    -0.30   0.763    -.0015336    .0011254
         _cons |   .5435233   .0495214    10.98   0.000     .4462131    .6408336
--------------------------------------------------------------------------------

Linear regression                               Number of obs     =      1,776
                                                F(7, 471)         =       6.34
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0339
                                                Root MSE          =     .23839

                                    (Std. err. adjusted for 472 clusters in lid)
--------------------------------------------------------------------------------
               |               Robust
        dpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
     persparty |   .0644692   .0296417     2.17   0.030     .0062229    .1227156
        attack |   .2184444   .0628209     3.48   0.001     .0950005    .3418882
            ld |   .0147154   .0074583     1.97   0.049     .0000598    .0293711
         ivdem |    .100539   .0574038     1.75   0.081    -.0122603    .2133382
l1polarization |  -.0229815   .0074155    -3.10   0.002    -.0375531   -.0084099
      election |    .046218   .0118755     3.89   0.000     .0228825    .0695534
          time |    .002553   .0007344     3.48   0.001     .0011099    .0039962
         _cons |   -.242244   .0597219    -4.06   0.000    -.3595983   -.1248898
--------------------------------------------------------------------------------
(776 missing values generated)
(776 missing values generated)
(776 missing values generated)
-----------------------------------------------------------------------------------
> -
        Effect                 |  Mean           [95% Conf. Interval]
-------------------------------+---------------------------------------------------
> -
        ACME                   |  .0161693      .0011999      .0378568
        Direct Effect          |  .0634098      .0078189      .1208874
        Total Effect           |  .0795791      .0223305      .1424227
        % of Tot Eff mediated  |  .2041752      .1115187      .6832362
-----------------------------------------------------------------------------------
> -

.                 local b =r(tau)

.                 replace t0=`b' if n==1
(1 real change made)

.                 local b = r(taulo)

.                 replace tlo=`b'  if n==1
(1 real change made)

.                 local b = r(tauhi)

.                 replace thi=`b'  if n==1
(1 real change made)

.                 local b =r(zeta0)

.                 replace z0=`b'  if n==1
(1 real change made)

.                 local b = r(zeta0lo)

.                 replace zlo=`b'  if n==1
(1 real change made)

.                 local b = r(zeta0hi)

.                 replace zhi=`b'  if n==1
(1 real change made)

.                                 * Initial level/total change *
.                 reg devpolar $d ld ivdem ipolar election time,cluster(lid)

Linear regression                               Number of obs     =        567
                                                F(6, 566)         =      80.52
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4472
                                                Root MSE          =     .40419

                                   (Std. err. adjusted for 567 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
     devpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .2210461   .0937394     2.36   0.019     .0369266    .4051656
           ld |   .0792257   .0259519     3.05   0.002     .0282518    .1301995
        ivdem |  -.1770346   .1492163    -1.19   0.236    -.4701198    .1160507
ipolarization |  -.2706057   .0164482   -16.45   0.000    -.3029126   -.2382988
     election |   .0198314   .0355555     0.56   0.577    -.0500054    .0896683
         time |   .0090666   .0016961     5.35   0.000     .0057352    .0123979
        _cons |  -.0325743   .1137173    -0.29   0.775    -.2559339    .1907852
-------------------------------------------------------------------------------

.                 reg devpolar $d attack ld ivdem ipolar election time,cluster(lid)

Linear regression                               Number of obs     =        567
                                                F(7, 566)         =      79.35
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4946
                                                Root MSE          =     .38681

                                   (Std. err. adjusted for 567 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
     devpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .1525305   .0837744     1.82   0.069    -.0120162    .3170771
       attack |   1.082036   .2099656     5.15   0.000     .6696291    1.494443
           ld |   .0945028   .0254873     3.71   0.000     .0444415     .144564
        ivdem |   .3093384   .1671402     1.85   0.065    -.0189523    .6376292
ipolarization |  -.2967475   .0162772   -18.23   0.000    -.3287185   -.2647765
     election |   -.001524   .0350387    -0.04   0.965    -.0703457    .0672977
         time |   .0090717   .0016521     5.49   0.000     .0058266    .0123167
        _cons |  -.6828988   .1735861    -3.93   0.000     -1.02385   -.3419472
-------------------------------------------------------------------------------

.                 reg attack $d  ld ivdem ipolar election time if devpolar~=.,clust
> er(lid)

Linear regression                               Number of obs     =        567
                                                F(6, 566)         =      95.16
                                                Prob > F          =     0.0000
                                                R-squared         =     0.5142
                                                Root MSE          =      .1094

                                   (Std. err. adjusted for 567 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
       attack | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |    .063321    .027652     2.29   0.022     .0090079    .1176341
           ld |  -.0141188   .0071492    -1.97   0.049     -.028161   -.0000767
        ivdem |   -.449498   .0394734   -11.39   0.000    -.5270302   -.3719659
ipolarization |   .0241598   .0042254     5.72   0.000     .0158605    .0324591
     election |   .0197364   .0095294     2.07   0.039      .001019    .0384537
         time |  -4.70e-06   .0005627    -0.01   0.993    -.0011099    .0011005
        _cons |   .6010194    .034009    17.67   0.000     .5342201    .6678187
-------------------------------------------------------------------------------

.                 medeff (regress attack $d ld ivdem ipolar election time)  ///
>                         (regress devpolar $d attack ld ivdem ipolar election time
> ), ///
>                         mediate(attack)treat($d)sims(1000)vce(cluster lid)
Using 0 and 1 as treatment values

Linear regression                               Number of obs     =        567
                                                F(6, 566)         =      95.16
                                                Prob > F          =     0.0000
                                                R-squared         =     0.5142
                                                Root MSE          =      .1094

                                   (Std. err. adjusted for 567 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
       attack | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |    .063321    .027652     2.29   0.022     .0090079    .1176341
           ld |  -.0141188   .0071492    -1.97   0.049     -.028161   -.0000767
        ivdem |   -.449498   .0394734   -11.39   0.000    -.5270302   -.3719659
ipolarization |   .0241598   .0042254     5.72   0.000     .0158605    .0324591
     election |   .0197364   .0095294     2.07   0.039      .001019    .0384537
         time |  -4.70e-06   .0005627    -0.01   0.993    -.0011099    .0011005
        _cons |   .6010194    .034009    17.67   0.000     .5342201    .6678187
-------------------------------------------------------------------------------

Linear regression                               Number of obs     =        567
                                                F(7, 566)         =      79.35
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4946
                                                Root MSE          =     .38681

                                   (Std. err. adjusted for 567 clusters in lid)
-------------------------------------------------------------------------------
              |               Robust
     devpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
    persparty |   .1525305   .0837744     1.82   0.069    -.0120162    .3170771
       attack |   1.082036   .2099656     5.15   0.000     .6696291    1.494443
           ld |   .0945028   .0254873     3.71   0.000     .0444415     .144564
        ivdem |   .3093384   .1671402     1.85   0.065    -.0189523    .6376292
ipolarization |  -.2967475   .0162772   -18.23   0.000    -.3287185   -.2647765
     election |   -.001524   .0350387    -0.04   0.965    -.0703457    .0672977
         time |   .0090717   .0016521     5.49   0.000     .0058266    .0123167
        _cons |  -.6828988   .1735861    -3.93   0.000     -1.02385   -.3419472
-------------------------------------------------------------------------------
The number of observations in the data is less than the number of simulations. Expa
> nding the data to the number of simulations
-----------------------------------------------------------------------------------
> -
        Effect                 |  Mean           [95% Conf. Interval]
-------------------------------+---------------------------------------------------
> -
        ACME                   |  .0670533       .010718      .1404682
        Direct Effect          |  .1495363     -.0075766      .3119814
        Total Effect           |  .2165896      .0461372      .3976237
        % of Tot Eff mediated  |  .3113043      .1626957       1.15665
-----------------------------------------------------------------------------------
> -

.                 local b =r(tau)

.                 replace t0=`b' if n==2
(1 real change made)

.                 local b = r(taulo)

.                 replace tlo=`b'  if n==2
(1 real change made)

.                 local b = r(tauhi)

.                 replace thi=`b'  if n==2
(1 real change made)

.                 local b =r(zeta0)

.                 replace z0=`b'  if n==2
(1 real change made)

.                 local b = r(zeta0lo)

.                 replace zlo=`b'  if n==2
(1 real change made)

.                 local b = r(zeta0hi)

.                 replace zhi=`b'  if n==2
(1 real change made)

.         twoway (bar t0 n if n==1,yscale(range(0 .2))barw(.2)ylab(0(.05).2)col(blu
> e*.25) xlab(1 "")) ///
>                         (bar z0 n if n==1,yscale(range(0 .2))col(blue*.65)barw(.2
> )legend(off) ///
>                         xtit(" ")) (bar t0 n if n==2,yscale(range(0 .2))barw(.2)c
> ol(blue*.25) ///
>                         ytit("Marginal effect of" "ruling party personalism")) (b
> ar z0 n if n==2,yscale(range(0 .2)) ///
>                         col(blue*.65)  barw(.2)xlab(1 " "  2 " ")xscale(range(0.8
>  2.2)) ///
>                         text(.1 1.17 "Indirect effect" "via attacks on" "{bf:Judi
> ciary}",size(small)) ///
>                         text(.175 1.76 "Indirect effect" "via attacks on" "{bf:Ju
> diciary}",size(small)) ///
>                         tit(Ruling party personalism increases polarization,size(
> Large)) ///
>                         subtit(via incumbent attacks on the state,size(small))xla
> b(1 "Yearly estimate" 2 "Total estimate") ///
>                         text(.075 1.77 "Direct effect of" "ruling party" "persona
> lism" "on polarization", size(2.2) color(gs4)) ///
>                         text(.035 1.23 "Direct effect of" "ruling party" "persona
> lism" "on polarization", size(2.2) color(gs4)) ///
>                         text(.18 2 "31%",size(small))text(.08 2 "69%",size(small)
> )text(.0725 1 "20%",size(small)) text(.035 1 "80%",size(small))) ///
>                         (pcarrowi .085 1.17 .0725 1.1) (pcarrowi .035 1.16 .035 1
> .1) 
(note:  named style Large not found in class gsize, default attributes used)

.         gr export "$dir\golden\Ch6-Macro-Polarization-mediation.pdf",as(pdf)repla
> ce 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\C
    > h6-Macro-Polarization-mediation.pdf saved as PDF format

.  
. 
. *** Merge in cy data ***
.         use "$dir\pers-use.dta",clear

.         tsset cowcode year

Panel variable: cowcode (unbalanced)
 Time variable: year, 1991 to 2020, but with gaps
         Delta: 1 unit

.                         ** Attacks on the State **
.                         tsset lid year

Panel variable: lid (unbalanced)
 Time variable: year, 1991 to 2020
         Delta: 1 unit

.                         alpha v2jupurge v2jupoatck v2jupack,item std gen(cattack)

Test scale = mean(standardized items)

                                                            Average
                             Item-test     Item-rest       interitem
Item         |  Obs  Sign   correlation   correlation     correlation     alpha
-------------+-----------------------------------------------------------------
v2jupurge    | 2392    +       0.8549        0.6559          0.4472      0.6180
v2jupoatck   | 2392    +       0.8209        0.5895          0.5314      0.6940
v2jupack     | 2392    +       0.7994        0.5497          0.5845      0.7378
-------------+-----------------------------------------------------------------
Test scale   |                                               0.5210      0.7654
-------------------------------------------------------------------------------

.                         replace cattack=cattack*-1
(2,392 real changes made)

.                         qui sum cattack

.                         qui replace cattack = (cattack+abs(r(min)))/(abs(r(min))+
> r(max))

.                         sum cattack

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
     cattack |      2,392    .2656246    .1535195          0          1

.                         twoway (line cattack year if country=="Turkey" & year>200
> 0,sort )  ///
>                                 (line cattack year if country=="Poland"& year>200
> 0,sort ylab(0 "Min"  .489328   "Mean"  1 "Max") ///
>                                 legend(lab(1 "Turkey")lab(2 "Poland")pos(5)ring(0
> )order(1 2))ytit(Attack on the state)xtit(Year) ) 

.                         gr export "$dir\golden\T-Attack1.pdf",as(pdf)replace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\T
    > -Attack1.pdf saved as PDF format

.                         twoway (line cattack year if country=="Turkey" & year>200
> 0,sort )  ///
>                                 (line cattack year if country=="Poland"& year>200
> 0,sort ylab(0 "Min"  .489328   "Mean"  1 "Max") ///
>                                 legend(lab(1 "Turkey")lab(2 "Poland")pos(5)ring(0
> )order(1 2))ytit(Attack on the state)xtit(Year) ///    
>                                 text(1.035 2016 "2016 failed coup &" "democratic 
> collapse",size(vsmall) )  ///
>                                 text(.5 2013.5 "2013 purge" "judges",size(vsmall)
>  ) ///
>                                 text(.8 2011.5 "2014 justice" "minister power to"
>  "appoint judges",size(vsmall) )) ///
>                                 (pcarrowi .52 2013.5 .7 2013)   (pcarrowi .8 2013
> .5 .8 2014.7)

.                         gr export "$dir\golden\T-Attack2.pdf",as(pdf)replace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\T
    > -Attack2.pdf saved as PDF format

.                         twoway (line cattack year if country=="Turkey" & year>200
> 0,sort )  ///
>                                 (line cattack year if country=="Poland"& year>200
> 0,sort ylab(0 "Min"  .489328   "Mean"  1 "Max") ///
>                                 legend(lab(1 "Turkey")lab(2 "Poland")pos(5)ring(0
> )order(1 2))ytit(Attack on the state)xtit(Year) ///    
>                                 text(.3 2011.5 "2015 PiS law" "to purge" "Constit
> utional" "Court",size(vsmall) ) ///
>                                 text(.62 2014.5 "2018 purge & pack" "National Cou
> ncil of the" "Judiciary (KRS)",size(vsmall) )) ///
>                                 (pcarrowi .31 2012.5 .38 2014.8)   (pcarrowi .64 
> 2016.1 .71 2017.8)             

.                         gr export "$dir\golden\T-Attack3.pdf",as(pdf)replace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\T
    > -Attack3.pdf saved as PDF format

.                         drop cattack

.                 
.                         local var = "v2jupurge v2jupoatck v2jupack"

.                         foreach v of local var {
  2.                                 gen l1`v'=l.`v'
  3.                         }
(592 missing values generated)
(592 missing values generated)
(592 missing values generated)

.                         alpha l1v2jupurge l1v2jupoatck l1v2jupack,item std gen(at
> tack)

Test scale = mean(standardized items)

                                                            Average
                             Item-test     Item-rest       interitem
Item         |  Obs  Sign   correlation   correlation     correlation     alpha
-------------+-----------------------------------------------------------------
l1v2jupurge  | 1800    +       0.8564        0.6592          0.4450      0.6159
l1v2jupoatck | 1800    +       0.8194        0.5870          0.5366      0.6985
l1v2jupack   | 1800    +       0.8003        0.5515          0.5840      0.7374
-------------+-----------------------------------------------------------------
Test scale   |                                               0.5219      0.7661
-------------------------------------------------------------------------------

.                         replace attack = attack*-1
(1,800 real changes made)

.                         qui sum attack

.                         replace attack=abs(r(min))+attack
(1,800 real changes made)

.                         hist attack,bin(50)
(bin=50, start=0, width=.08985198)

.                         gen ojud = l1v2x_jucon if year==min
(1,815 missing values generated)

.                         egen ijud = max(ojud),by(lid)
(55 missing values generated)

.                         gen opolar = l1polar if year==min
(1,823 missing values generated)

.                         egen ipolar = max(opolar),by(lid)
(86 missing values generated)

.                         replace vdem_country = "Republic of Korea" if vdem_countr
> y=="South Korea"
(30 real changes made)

.                         replace vdem_country = "Great Britain" if vdem_country=="
> United Kingdom"
(30 real changes made)

.                         replace vdem_country = "Czech Republic" if vdem_country==
> "Czech Republic"
(0 real changes made)

.                         replace vdem_country = "Greece" if vdem_country=="Greece"
>   
(0 real changes made)

.           * Greece 2012; Czech Republic 2010 dropped due to leader being technocr
> atic appointment *
.           * Non-GWF democracy on January 1: Taiwan 1996; Mexico 1997, 2000;  Peru
>  2000, 2001; Thailand 2007   *
.           * Not coded for leader: Switzerland 1999, 2003, 2007, 2011 *
.           * Not in GWF, too small: Montenegro 2012 *    
.          sort vdem_country year

.          merge vdem_country year using cses-temp
(you are using old merge syntax; see [D] merge for new syntax)
(note: variable country was int in the using data, but will be str45 now)
(variable id was int, now float to accommodate using data's values)
variables vdem_country year do not uniquely identify observations in
    cses-temp.dta
(label paind_ord already defined)

.          tab vdem_country year if _merge==2

                      |                    year
         Country name |      1996       1997       1999       2000 |     Total
----------------------+--------------------------------------------+----------
       Czech Republic |         0          0          0          0 |     1,857 
               Greece |         0          0          0          0 |     1,029 
               Mexico |         0      2,033          0      1,766 |     3,799 
           Montenegro |         0          0          0          0 |       967 
                 Peru |         0          0          0      1,102 |     2,220 
          Switzerland |         0          0      2,048          0 |    11,021 
               Taiwan |     1,200          0          0          0 |     1,200 
             Thailand |         0          0          0          0 |     1,990 
----------------------+--------------------------------------------+----------
                Total |     1,200      2,033      2,048      2,868 |    24,083 


                      |                    year
         Country name |      2001       2003       2007       2010 |     Total
----------------------+--------------------------------------------+----------
       Czech Republic |         0          0          0      1,857 |     1,857 
               Greece |         0          0          0          0 |     1,029 
               Mexico |         0          0          0          0 |     3,799 
           Montenegro |         0          0          0          0 |       967 
                 Peru |     1,118          0          0          0 |     2,220 
          Switzerland |         0      1,418      3,164          0 |    11,021 
               Taiwan |         0          0          0          0 |     1,200 
             Thailand |         0          0      1,990          0 |     1,990 
----------------------+--------------------------------------------+----------
                Total |     1,118      1,418      5,154      1,857 |    24,083 


                      |         year
         Country name |      2011       2012 |     Total
----------------------+----------------------+----------
       Czech Republic |         0          0 |     1,857 
               Greece |         0      1,029 |     1,029 
               Mexico |         0          0 |     3,799 
           Montenegro |         0        967 |       967 
                 Peru |         0          0 |     2,220 
          Switzerland |     4,391          0 |    11,021 
               Taiwan |         0          0 |     1,200 
             Thailand |         0          0 |     1,990 
----------------------+----------------------+----------
                Total |     4,391      1,996 |    24,083 

.          drop if _merge==2
(24,083 observations deleted)

.          drop _merge

.          keep if polar~=. & attack~=.
(109,604 observations deleted)

.          gen xpolar = (polar+10)/20

.          hist xpolar
(bin=51, start=0, width=.01960784)

.          gen x1polar = xpolar^(1.45)

.          swilk xpolar x1polar if attack~=.

                   Shapiro–Wilk W test for normal data

    Variable |        Obs       W           V         z       Prob>z
-------------+------------------------------------------------------
      xpolar |    136,439    0.99181    308.562    16.123    0.00000
     x1polar |    136,439    0.99849     56.759    11.361    0.00000

Note: The normal approximation to the sampling distribution of W'
      is valid for 4<=n<=2000.

.          hist x1polar
(bin=51, start=0, width=.01960784)

.           
.          * Descriptive trends *
.          qui sum polarization 

.          qui egen vpolar = std(polarization)                                     
>                        /* VDem macro polarization */

.          qui egen cpolar = std(x1polar)                                          
>                                /* CSES micro polarization */

.          sum vpolar cpolar

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      vpolar |    131,978    9.16e-10           1  -1.895859   2.940304
      cpolar |    136,439   -2.61e-09           1  -3.686895    2.41008

.          qui egen scpolar = mean(cpolar),by(surveyid)

.          egen stag1 = tag(surveyid) if vpolar~=. & scpolar~=. 

.          egen std_vpolar=std(vpolar) if stag1==1
(136,317 missing values generated)

.          egen std_scpolar=std(scpolar) if stag1==1
(136,317 missing values generated)

.          sum std_* if stag1==1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  std_vpolar |        122    1.80e-09           1  -1.980663   2.899269
 std_scpolar |        122   -2.17e-09           1  -3.518908   3.482403

.          twoway (lpoly std_vpolar year if stag1==1,bw(4)ylab(-.3(.3).3) ytit(Pola
> rization)tit("Polarization trending upwards"))  ///
>                 (lpoly std_scpolar year if stag1==1, bw(3.5) xtit(Year,size(small
> )) ///
>                  legend(lab(1 "VDem-polarization")lab(2 "CSES-polarization") ///
>                 pos(5)ring(0)col(1))note("Standardized variables; N=122.",pos(6)s
> ize(vsmall)) )

.          gr export "$dir\golden\Ch6-Polarization-trends.pdf",as(pdf)replace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\C
    > h6-Polarization-trends.pdf saved as PDF format

.          
.          * Two measures are within correlated *
.          krls std_scpolar i.cowcode  std_vpolar if stag1==1 
Iteration =  1, Looloss: 118.0115  
Iteration =  2, Looloss: 116.2989  
Iteration =  3, Looloss: 113.6839  
Iteration =  4, Looloss: 109.7948  
Iteration =  5, Looloss: 104.2507  
Iteration =  6, Looloss: 96.82834  
Iteration =  7, Looloss: 87.70483  
Iteration =  8, Looloss: 77.64164  
Iteration =  9, Looloss: 67.89487  
Iteration = 10, Looloss: 59.75962  
Iteration = 11, Looloss: 53.98485  
Iteration = 12, Looloss: 50.51457  
Iteration = 13, Looloss: 48.74307  
Iteration = 14, Looloss: 47.97172  

Pointwise Derivatives                                     Number of obs =      122 
                                                          Lambda        =    .1016 
                                                          Tolerance     =     .122 
                                                          Sigma         =       46 
                                                          Eff. df       =    44.68 
                                                          R2            =    .8745 
                                                          Looloss       =    47.61

 std_scpolar |      Avg.       SE        t    P>|t|        P25       P50       P75 
>       
-------------+--------------------------------------------------------------------
 *20.cowcode | -.075854   .119686   -0.634    0.528   -.280693  -.090507    .08376 
>  
 *70.cowcode |  .217459   .112373    1.935    0.057    .040344   .234676   .437003 
>  
*135.cowcode | -.037004   .131546   -0.281    0.779   -.279933    -.0237   .171327 
>  
*140.cowcode | -.596751   .125406   -4.759    0.000   -.889077  -.658592  -.384316 
>  
*155.cowcode | -.304056   .151328   -2.009    0.048   -.603367  -.380959  -.046957 
>  
*160.cowcode | -.101206    .18967   -0.534    0.595   -.493305  -.124751   .232195 
>  
*165.cowcode |  .415954   .188856    2.202    0.031    .063923   .457381   .833388 
>  
*200.cowcode | -.076408   .131008   -0.583    0.561   -.324175  -.084707    .13517 
>  
*205.cowcode |  .028185   .124609    0.226    0.822   -.207804   .032286   .251999 
>  
*210.cowcode | -.497532   .119819   -4.152    0.000   -.774613   -.52453   -.32668 
>  
*211.cowcode | -.158644   .130288   -1.218    0.227   -.377736  -.187412   .039901 
>  
*220.cowcode | -.272304   .129366   -2.105    0.039   -.546355  -.343433  -.076231 
>  
*230.cowcode |   .21598   .119712    1.804    0.075    .019911   .243777   .464964 
>  
*235.cowcode |  .454066   .120237    3.776    0.000    .283271   .469457     .6825 
>  
*255.cowcode |   .14792   .109624    1.349    0.181   -.002418   .155265   .341132 
>  
*290.cowcode |  .221473   .125284    1.768    0.081    .022226   .244265   .472522 
>  
*305.cowcode |  .164086    .15159    1.082    0.282   -.097614   .202673    .46762 
>  
*310.cowcode |  .519371   .152249    3.411    0.001    .266863   .534065    .86384 
>  
*316.cowcode |  .543715   .138671    3.921    0.000    .304722   .569786    .82757 
>  
*317.cowcode |  .439525   .152356    2.885    0.005    .154796   .463243   .774189 
>  
*325.cowcode |  .145084   .195115    0.744    0.459   -.197872   .193232   .514819 
>  
*339.cowcode |  .266881   .199512    1.338    0.185   -.080671   .314232   .659992 
>  
*344.cowcode | -.142734   .196759   -0.725    0.470   -.524602   -.18871   .181932 
>  
*345.cowcode |  .345392   .198743    1.738    0.086    .020706   .390318   .758712 
>  
*349.cowcode | -.121329   .120124   -1.010    0.316   -.308377  -.148348   .052284 
>  
*350.cowcode |  .231283   .150114    1.541    0.128   -.020838   .284026   .562399 
>  
*355.cowcode |  .825164   .199391    4.138    0.000    .398944    .84184   1.28602 
>  
*360.cowcode | -.022727   .113564   -0.200    0.842    -.16287  -.039813    .11747 
>  
*366.cowcode |  .035823   .197711    0.181    0.857   -.331254   .052002   .384586 
>  
*367.cowcode |  .350213   .194124    1.804    0.075   -.010241   .396025   .758701 
>  
*369.cowcode |  .851096   .196315    4.335    0.000    .455004   .898305   1.29531 
>  
*375.cowcode |  -.24957     .1518   -1.644    0.104    -.53863  -.306435   .000668 
>  
*380.cowcode |  .169506   .119383    1.420    0.160   -.030371   .193987   .408632 
>  
*385.cowcode |   .05716    .13686    0.418    0.677   -.150476   .087396   .282435 
>  
*390.cowcode |  .265784   .127612    2.083    0.041    .047741   .285126   .555084 
>  
*501.cowcode | -.078998   .193524   -0.408    0.684   -.468421    -.0984   .256223 
>  
*560.cowcode |  .780987   .151204    5.165    0.000    .377642   .799599   1.15225 
>  
*640.cowcode |  1.01976   .155282    6.567    0.000    .441201   1.07519   1.53209 
>  
*666.cowcode |  .008473   .130754    0.065    0.949   -.256911   .011262   .217189 
>  
*713.cowcode | -.505375   .197296   -2.562    0.012   -.915825  -.565367  -.195828 
>  
*732.cowcode | -.462557   .130211   -3.552    0.001   -.768584  -.512615  -.253378 
>  
*800.cowcode |  .529518   .171504    3.087    0.003     .21759   .530587   .966584 
>  
*840.cowcode | -1.42525   .152429   -9.350    0.000   -1.98598  -1.49928  -.905328 
>  
*900.cowcode |  .014688   .119743    0.123    0.903   -.187892   .016411    .19429 
>  
*920.cowcode |  .319743   .113456    2.818    0.006    .132077   .337744   .528343 
>  
  std_vpolar |  .077119   .037458    2.059    0.043    .042143   .074787   .098494 
>  
-------------+--------------------------------------------------------------------


.          reghdfe std_scpolar std_vpolar  if stag1==1,a(cowcode)vce(rob)
(dropped 13 singleton observations)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =        109
Absorbing 1 HDFE group                            F(   1,     75) =       2.54
                                                  Prob > F        =     0.1151
                                                  R-squared       =     0.8559
                                                  Adj R-squared   =     0.7925
                                                  Within R-sq.    =     0.0290
                                                  Root MSE        =     0.4479

------------------------------------------------------------------------------
             |               Robust
 std_scpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
  std_vpolar |   .3266032    .204881     1.59   0.115    -.0815407    .7347471
       _cons |  -.0592959   .0436967    -1.36   0.179    -.1463443    .0277525
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
     cowcode |        33           0          33     |
-----------------------------------------------------+

.          reghdfe x1polar polarization,a(cowcode)cluster(surveyid)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =    131,978
Absorbing 1 HDFE group                            F(   1,    121) =       3.96
Statistics robust to heteroskedasticity           Prob > F        =     0.0490
                                                  R-squared       =     0.0874
                                                  Adj R-squared   =     0.0871
                                                  Within R-sq.    =     0.0005
Number of clusters (surveyid) =        122        Root MSE        =     0.1579

                             (Std. err. adjusted for 122 clusters in surveyid)
------------------------------------------------------------------------------
             |               Robust
     x1polar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
polarization |   .0125386   .0063041     1.99   0.049      .000058    .0250192
       _cons |    .618198   .0067634    91.40   0.000     .6048082    .6315879
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
     cowcode |        46           0          46     |
-----------------------------------------------------+

.          
.          * Kernel regression plot for country averages *
.          krls attack persparty ijud ivdem ld ipolar if stag1==1, 
Iteration =  1, Looloss: 66.41641  
Iteration =  2, Looloss: 61.1438   
Iteration =  3, Looloss: 55.47196  
Iteration =  4, Looloss: 49.92263  
Iteration =  5, Looloss: 44.91557  
Iteration =  6, Looloss: 40.62515  
Iteration =  7, Looloss: 37.00961  
Iteration =  8, Looloss: 33.94502  
Iteration =  9, Looloss: 31.33349  
Iteration = 10, Looloss: 29.13821  
Iteration = 11, Looloss: 27.37412  
Iteration = 12, Looloss: 26.07126  
Iteration = 13, Looloss: 25.22008  
Iteration = 14, Looloss: 24.7429   

Pointwise Derivatives                                   Number of obs =      120 
                                                        Lambda        =   .09574 
                                                        Tolerance     =      .12 
                                                        Sigma         =        5 
                                                        Eff. df       =    39.49 
                                                        R2            =    .9132 
                                                        Looloss       =    24.44

    attack |      Avg.       SE        t    P>|t|        P25       P50       P75   
>     
-----------+--------------------------------------------------------------------
 persparty |  .553394    .13868    3.990    0.000   -.327472   .343748   1.49432  
      ijud | -1.21733   .588799   -2.067    0.041   -2.48754  -1.29035  -.144636  
     ivdem | -1.14488   .643345   -1.780    0.078   -2.26629  -.864894   .339809  
        ld | -.026602   .036754   -0.724    0.471   -.225444   .015103   .172601  
    ipolar |  .098998   .023937    4.136    0.000   -.025769   .067648   .227808  
-----------+--------------------------------------------------------------------


.          krls scpolar attack ijud ivdem ld ipolar if stag1==1,d(k1)
Iteration =  1, Looloss: 42.22492  
Iteration =  2, Looloss: 41.94805  
Iteration =  3, Looloss: 41.56807  
Iteration =  4, Looloss: 41.07493  
Iteration =  5, Looloss: 40.46331  
Iteration =  6, Looloss: 39.72481  
Iteration =  7, Looloss: 38.85041  
Iteration =  8, Looloss: 37.84618  
Iteration =  9, Looloss: 36.74411  
Iteration = 10, Looloss: 35.60061  
Iteration = 11, Looloss: 34.49547  
Iteration = 12, Looloss: 33.52686  
Iteration = 13, Looloss: 32.78001  
Iteration = 14, Looloss: 32.28492  
Iteration = 15, Looloss: 32.00693  
Iteration = 16, Looloss: 31.87724  

Pointwise Derivatives                                Number of obs =      120 
                                                     Lambda        =    .1168 
                                                     Tolerance     =      .12 
                                                     Sigma         =        5 
                                                     Eff. df       =    34.47 
                                                     R2            =    .6941 
                                                     Looloss       =    31.82

scpolar |      Avg.       SE        t    P>|t|        P25       P50       P75      
>  
--------+--------------------------------------------------------------------
 attack |  .188317   .062395    3.018    0.003      .0455   .211924    .30993  
   ijud |  1.37461   .582271    2.361    0.020    .801334   1.71708   2.13879  
  ivdem |  .595579   .658104    0.905    0.367     -.9901   .399845    2.6302  
     ld | -.131229   .033025   -3.974    0.000   -.240213  -.116338  -.027367  
 ipolar | -.033613   .021947   -1.532    0.128   -.128919  -.063493   .030953  
--------+--------------------------------------------------------------------


.          xtreg scpolar attack ijud ivdem ld ipolar if stag1==1, i(cowcode)
warning: existing panel variable is not cowcode

Random-effects GLS regression                   Number of obs     =        120
Group variable: cowcode                         Number of groups  =         46

R-squared:                                      Obs per group:
     Within  = 0.0698                                         min =          1
     Between = 0.1070                                         avg =        2.6
     Overall = 0.1119                                         max =          5

                                                Wald chi2(5)      =      10.48
corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0627

------------------------------------------------------------------------------
     scpolar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
      attack |    .219771   .0769117     2.86   0.004     .0690268    .3705151
        ijud |   .5193819   .3866543     1.34   0.179    -.2384466     1.27721
       ivdem |   .4314566   .6408504     0.67   0.501    -.8245872      1.6875
          ld |   -.047633   .0538252    -0.88   0.376    -.1531284    .0578625
      ipolar |   -.020906   .0416182    -0.50   0.615    -.1024761    .0606642
       _cons |  -.8201376   .4786141    -1.71   0.087    -1.758204    .1179288
-------------+----------------------------------------------------------------
     sigma_u |   .3638682
     sigma_e |  .15573015
         rho |  .84518623   (fraction of variance due to u_i)
------------------------------------------------------------------------------

.          reghdfe scpolar attack ijud ivdem ld ipolar if stag1==1, a(cowcode)clust
> er(lid)
(dropped 13 singleton observations)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =        107
Absorbing 1 HDFE group                            F(   5,     69) =       5.80
Statistics robust to heteroskedasticity           Prob > F        =     0.0002
                                                  R-squared       =     0.8734
                                                  Adj R-squared   =     0.8055
                                                  Within R-sq.    =     0.1537
Number of clusters (lid)     =         77         Root MSE        =     0.1557

                                   (Std. err. adjusted for 77 clusters in lid)
------------------------------------------------------------------------------
             |               Robust
     scpolar | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
      attack |   .1773614   .0797171     2.22   0.029     .0183302    .3363927
        ijud |   .5200963   .3255601     1.60   0.115    -.1293783    1.169571
       ivdem |   3.851385   1.537661     2.50   0.015     .7838354    6.918935
          ld |   .0232862   .0660168     0.35   0.725    -.1084137     .154986
      ipolar |   -.068249   .0780477    -0.87   0.385      -.22395     .087452
       _cons |  -4.005512   1.268371    -3.16   0.002    -6.535842   -1.475181
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
     cowcode |        33           0          33     |
-----------------------------------------------------+

.          twoway lpolyci k1_attack persparty,bw(.15)xtit(Ruling party personalism)
> xlab(0(.2).8)  ///
>                 ytit(Marginal effect of judicial attacks)legend(off)yline(0,lpat(
> solid)lcol(gs4)) ///
>                 yline(.518923,lpat(dash))tit(CSES polarization)

.          drop k1*

.          
.          egen std_attack =std(attack) if stag==1
(136,317 missing values generated)

.          gen hipers = persparty>.45 if persparty~=.

.          ttest std_attack if stag==1,by(hipers)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |      54   -.3048369     .123601    .9082784   -.5527491   -.0569246
       1 |      68    .2420763    .1224151    1.009461   -.0022653    .4864179
---------+--------------------------------------------------------------------
Combined |     122   -2.39e-09    .0905357           1   -.1792394    .1792394
---------+--------------------------------------------------------------------
    diff |           -.5469132    .1760927               -.8955646   -.1982618
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -3.1058
H0: diff = 0                                     Degrees of freedom =      120

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0012         Pr(|T| > |t|) = 0.0024          Pr(T > t) = 0.9988

.           
.          * Analysis *
.           gen pXa = persparty*attack

.           global dvar="leftself rightself age female employed union i.income i.ur
> ban i.education"

.           global cvar="ld ivdem ijud"

.           global d = "attack"

.           sum x1polar $d persparty $pvar $cvar $dvar

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
     x1polar |    136,439    .6047089    .1640158          0          1
      attack |    136,439    .8460933    .6216755          0   4.128828
   persparty |    136,439    .4082836    .1980142          0   .8906565
          ld |    136,439     3.81533    .9462541   1.386294   4.955827
       ivdem |    136,439    .8388887    .0935096       .421       .913
-------------+---------------------------------------------------------
        ijud |    134,270    .9050111    .1106817       .408       .992
  leftselfid |    136,439    .1957065     .396745          0          1
 rightselfid |    136,439    .2907233    .4540978          0          1
         age |    135,691    47.50442    16.76279         16        102
      female |    136,239    .5142727    .4997981          0          1
-------------+---------------------------------------------------------
    employed |    136,439    .3831016    .4861445          0          1
       union |    136,439    .2583352    .4377208          0          1
             |
      income |
          0  |    136,439    .4982373    .4999987          0          1
          1  |    136,439     .333607    .4715029          0          1
          9  |    136,439    .1681557    .3740059          0          1
-------------+---------------------------------------------------------
             |
       urban |
          0  |    136,439    .4124481    .4922768          0          1
          1  |    136,439    .4314969    .4952869          0          1
          8  |    136,439    .0004837    .0219887          0          1
          9  |    136,439    .1555714    .3624498          0          1
             |
   education |
          0  |    136,439    .3629534    .4808533          0          1
-------------+---------------------------------------------------------
          1  |    136,439    .2787619    .4483918          0          1
          2  |    136,439    .3440585     .475062          0          1
          9  |    136,439    .0142261    .1184224          0          1

. 
.          * Model selection: scale with country intercepts; cloglog link with log(
> default) slink *
.          local var  = "logit probit clog loglog logc"

.          local i  =1

.          foreach v of local var {
  2.                  qui xi:glm x1polar attack $cvar $dvar,family(binomial)link(`v
> ')vce(cluster surveyid)
  3.                  lincom attack
  4.                  est store p`i'
  5.                  local i = `i'+1
  6.          }

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1252639   .0513907     2.44   0.015       .02454    .2259878
------------------------------------------------------------------------------

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0780228   .0317584     2.46   0.014     .0157775    .1402682
------------------------------------------------------------------------------

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0824881    .032168     2.56   0.010     .0194401    .1455362
------------------------------------------------------------------------------

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0976383   .0411873     2.37   0.018     .0169127     .178364
------------------------------------------------------------------------------

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0742321   .0322249    -2.30   0.021    -.1373918   -.0110725
------------------------------------------------------------------------------

.      estimates table p1 p2 p3 p4 p5,stats(bic)  /* lowest BIC is clog link */

-------------------------------------------------------------------------------
    Variable |     p1           p2           p3           p4           p5      
-------------+-----------------------------------------------------------------
      attack |  .12526392    .07802284    .08248815    .09763834   -.07423214  
          ld | -.04573603   -.02842641   -.03021393   -.03543535    .02674625  
       ivdem | -.36447103   -.22485701   -.23227442   -.28867056    .22317756  
        ijud |  .92365206    .57493452    .61266451    .71425593   -.53764842  
  leftselfid |  .24460956    .15168618    .15899713    .19211043    -.1475213  
 rightselfid |  .22460862    .13927921    .14604221    .17634298   -.13536829  
         age |   .0031105    .00192823    .00202432    .00243267   -.00185441  
      female |   .0230674    .01427838    .01488911    .01812764   -.01388879  
    employed |  .02079576    .01289679    .01353881    .01625165   -.01236252  
       union | -.03092821   -.01923537   -.02053608    -.0238419    .01786262  
  _Iincome_1 | -.01095947   -.00675371   -.00687383   -.00882237    .00696881  
  _Iincome_9 |    .043777     .0273085    .02945131    .03348155   -.02485729  
   _Iurban_1 | -.00485868   -.00294232   -.00276619   -.00413342    .00345682  
   _Iurban_8 | -.14781251    -.0920236   -.09921211    -.1130517    .08393246  
   _Iurban_9 | -.09867945   -.06132985   -.06507524   -.07661814    .05796702  
_Ieducatio~1 | -.02000511   -.01242137   -.01303427   -.01566656    .01196447  
_Ieducatio~2 | -.04872855   -.03026856   -.03188672   -.03802846     .0289161  
_Ieducatio~9 |  -.0471423   -.02941654    -.0317964   -.03592163    .02652126  
       _cons |  -.2714608    -.1696979   -.54380632    .15338829   -.53052856  
-------------+-----------------------------------------------------------------
         bic |  123616.12    123614.28    123607.47    123621.83    123628.77  
-------------------------------------------------------------------------------

.          gen psample  = e(sample)==1

.                  
.          * Build a GMM specification *  No mixed effects
.          qui xi:glm x1polar attack,family(binomial)link(clog)vce(cluster surveyid
> ) 

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0647674   .0302324     2.14   0.032      .005513    .1240218
------------------------------------------------------------------------------

.          qui xi:glm x1polar attack ijud,family(binomial)link(clog)vce(cluster sur
> veyid) 

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1057009   .0352082     3.00   0.003     .0366941    .1747078
------------------------------------------------------------------------------

.          qui xi:glm x1polar attack ijud ivdem ld,family(binomial)link(clog)vce(cl
> uster surveyid) 

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0795093   .0367493     2.16   0.030     .0074821    .1515366
------------------------------------------------------------------------------

.          qui xi:glm x1polar attack ijud ivdem ld ipolar,family(binomial)link(clog
> )vce(cluster surveyid) 

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1005548   .0394622     2.55   0.011     .0232103    .1778992
------------------------------------------------------------------------------

.          qui xi:glm x1polar attack ijud ivdem ld ipolar $dvar,family(binomial)lin
> k(clog)vce(cluster surveyid) 

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1022326   .0346317     2.95   0.003     .0343557    .1701095
------------------------------------------------------------------------------

.          qui xi:glm x1polar attack persparty ijud ivdem ld ipolar $dvar,family(bi
> nomial)link(clog)vce(cluster surveyid) 

.                  lincom attack 

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1158201   .0386258     3.00   0.003      .040115    .1915252
------------------------------------------------------------------------------

.  
.          * Model some heterogeneity *
.          xi:glm x1polar attack persparty pXa $cvar $dvar,family(binomial)link(clo
> g)vce(cluster surveyid) 
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)
note: x1polar has noninteger values

Iteration 0:  Log pseudolikelihood = -61691.292  
Iteration 1:  Log pseudolikelihood = -61613.278  
Iteration 2:  Log pseudolikelihood = -61613.241  
Iteration 3:  Log pseudolikelihood = -61613.241  

Generalized linear models                         Number of obs   =    133,457
Optimization     : ML                             Residual df     =    133,436
                                                  Scale parameter =          1
Deviance         =  15655.73492                   (1/df) Deviance =   .1173277
Pearson          =  14194.97563                   (1/df) Pearson  =   .1063804

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(-ln(1-u))            [Complementary log-log]

                                                  AIC             =   .9236569
Log pseudolikelihood = -61613.24149               BIC             =   -1559094

                              (Std. err. adjusted for 124 clusters in surveyid)
-------------------------------------------------------------------------------
              |               Robust
      x1polar | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |  -.0901026   .0515405    -1.75   0.080    -.1911201     .010915
    persparty |  -.4138198   .1018222    -4.06   0.000    -.6133876   -.2142521
          pXa |   .3490731   .0840142     4.15   0.000     .1844084    .5137378
           ld |  -.0568569   .0179147    -3.17   0.002     -.091969   -.0217449
        ivdem |  -.2339832   .2214948    -1.06   0.291     -.668105    .2001386
         ijud |   .6613814    .146685     4.51   0.000      .373884    .9488788
   leftselfid |   .1554974   .0096541    16.11   0.000     .1365758     .174419
  rightselfid |   .1434649   .0105794    13.56   0.000     .1227296    .1642002
          age |   .0020217   .0002304     8.78   0.000     .0015702    .0024732
       female |   .0139825    .004225     3.31   0.001     .0057017    .0222633
     employed |   .0061066   .0105787     0.58   0.564    -.0146274    .0268405
        union |  -.0217679   .0093267    -2.33   0.020    -.0400478    -.003488
   _Iincome_1 |  -.0076409   .0052424    -1.46   0.145    -.0179158     .002634
   _Iincome_9 |   .0364489   .0154833     2.35   0.019     .0061022    .0667956
    _Iurban_1 |  -.0101088   .0075305    -1.34   0.179    -.0248683    .0046506
    _Iurban_8 |  -.1394439   .0188328    -7.40   0.000    -.1763555   -.1025323
    _Iurban_9 |  -.0382617   .0290193    -1.32   0.187    -.0951385    .0186151
_Ieducation_1 |  -.0150666   .0101744    -1.48   0.139     -.035008    .0048749
_Ieducation_2 |  -.0279726   .0104973    -2.66   0.008     -.048547   -.0073982
_Ieducation_9 |  -.0372814    .025882    -1.44   0.150    -.0880091    .0134463
        _cons |  -.3031988   .1318386    -2.30   0.021    -.5615978   -.0447998
-------------------------------------------------------------------------------

.                         lincom attack + pXa*(.427374 - .188941)

 ( 1)  [x1polar]attack + .238433*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   -.006872    .033832    -0.20   0.839    -.0731816    .0594376
------------------------------------------------------------------------------

.                         lincom attack + pXa*(.427374 + .188941)

 ( 1)  [x1polar]attack + .616315*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1250364   .0198104     6.31   0.000     .0862088     .163864
------------------------------------------------------------------------------

.           xi:reg x1polar attack persparty pXa $cvar $dvar
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

      Source |       SS           df       MS      Number of obs   =   133,457
-------------+----------------------------------   F(20, 133436)   =    477.13
       Model |   239.64998        20   11.982499   Prob > F        =    0.0000
    Residual |  3351.07369   133,436  .025113715   R-squared       =    0.0667
-------------+----------------------------------   Adj R-squared   =    0.0666
       Total |  3590.72367   133,456  .026905674   Root MSE        =    .15847

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |  -.0325977   .0022539   -14.46   0.000    -.0370152   -.0281802
    persparty |  -.1485265   .0040889   -36.32   0.000    -.1565406   -.1405124
          pXa |   .1244442   .0037249    33.41   0.000     .1171436    .1317449
           ld |  -.0204406   .0007059   -28.96   0.000    -.0218242    -.019057
        ivdem |  -.0848603   .0089652    -9.47   0.000    -.1024319   -.0672887
         ijud |   .2338071   .0069263    33.76   0.000     .2202317    .2473826
   leftselfid |   .0568601   .0011668    48.73   0.000     .0545732    .0591469
  rightselfid |   .0524992   .0010149    51.73   0.000       .05051    .0544884
          age |    .000742   .0000276    26.93   0.000      .000688     .000796
       female |   .0051546   .0008848     5.83   0.000     .0034203    .0068888
     employed |   .0023257   .0009794     2.37   0.018     .0004061    .0042452
        union |    -.00787   .0010387    -7.58   0.000    -.0099059   -.0058341
   _Iincome_1 |  -.0028354   .0010278    -2.76   0.006    -.0048499   -.0008208
   _Iincome_9 |    .012975   .0012399    10.46   0.000     .0105448    .0154052
    _Iurban_1 |  -.0038923   .0009666    -4.03   0.000    -.0057867   -.0019978
    _Iurban_8 |  -.0502648   .0201471    -2.49   0.013    -.0897528   -.0107767
    _Iurban_9 |  -.0140234   .0013428   -10.44   0.000    -.0166552   -.0113917
_Ieducation_1 |   -.005428   .0011362    -4.78   0.000    -.0076548   -.0032012
_Ieducation_2 |  -.0099658   .0011354    -8.78   0.000    -.0121911   -.0077404
_Ieducation_9 |  -.0133774   .0038674    -3.46   0.001    -.0209574   -.0057974
        _cons |   .5261882    .006884    76.44   0.000     .5126956    .5396807
-------------------------------------------------------------------------------

.                         lincom attack + pXa*(.427374 - .188941)

 ( 1)  attack + .238433*pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0029261   .0015256    -1.92   0.055    -.0059162    .0000641
------------------------------------------------------------------------------

.                         lincom attack + pXa*(.427374 + .188941)

 ( 1)  attack + .616315*pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0440992   .0010938    40.32   0.000     .0419553    .0462431
------------------------------------------------------------------------------

.           xi:mixed x1polar attack persparty pXa $cvar $dvar || surveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  61004.797  
Iteration 1:  Log likelihood =  61004.797  

Computing standard errors ...

Mixed-effects ML regression                         Number of obs    = 133,457
Group variable: surveyid                            Number of groups =     124
                                                    Obs per group:
                                                                 min =     161
                                                                 avg = 1,076.3
                                                                 max =   3,632
                                                    Wald chi2(20)    = 4760.54
Log likelihood =  61004.797                         Prob > chi2      =  0.0000

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |    -.04889   .0219628    -2.23   0.026    -.0919364   -.0058437
    persparty |  -.1687619   .0445847    -3.79   0.000    -.2561463   -.0813775
          pXa |    .145376   .0368639     3.94   0.000     .0731242    .2176279
           ld |  -.0241103   .0068419    -3.52   0.000    -.0375201   -.0107005
        ivdem |  -.0077611   .0880512    -0.09   0.930    -.1803382     .164816
         ijud |   .1579261   .0662652     2.38   0.017     .0280486    .2878035
   leftselfid |   .0550205   .0011526    47.74   0.000     .0527615    .0572795
  rightselfid |   .0532228   .0010064    52.88   0.000     .0512503    .0551954
          age |   .0005239   .0000279    18.81   0.000     .0004693    .0005785
       female |   .0029423   .0008581     3.43   0.001     .0012605     .004624
     employed |   -.004138   .0010191    -4.06   0.000    -.0061354   -.0021405
        union |  -.0030035   .0010853    -2.77   0.006    -.0051307   -.0008764
   _Iincome_1 |  -.0008787   .0010048    -0.87   0.382    -.0028481    .0010908
   _Iincome_9 |   .0040596   .0013218     3.07   0.002     .0014688    .0066503
    _Iurban_1 |  -.0007295    .000991    -0.74   0.462    -.0026718    .0012128
    _Iurban_8 |  -.0181347   .0196305    -0.92   0.356    -.0566097    .0203404
    _Iurban_9 |   .0141934   .0050719     2.80   0.005     .0042527    .0241342
_Ieducation_1 |  -.0083362   .0011706    -7.12   0.000    -.0106305   -.0060419
_Ieducation_2 |   -.014108   .0011925   -11.83   0.000    -.0164453   -.0117708
_Ieducation_9 |  -.0117552   .0039603    -2.97   0.003    -.0195172   -.0039931
        _cons |   .5695278   .0615777     9.25   0.000     .4488377    .6902178
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0025081   .0003245      .0019463     .003232
-----------------------------+------------------------------------------------
               var(Residual) |   .0233672   .0000905      .0231905    .0235453
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 9022.03       Prob >= chibar2 = 0.0000

.                         lincom attack + pXa*(.427374 - .188941)

 ( 1)  [x1polar]attack + .238433*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0142276   .0146993    -0.97   0.333    -.0430377    .0145826
------------------------------------------------------------------------------

.                         lincom attack + pXa*(.427374 + .188941)

 ( 1)  [x1polar]attack + .616315*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0407074   .0105129     3.87   0.000     .0201026    .0613122
------------------------------------------------------------------------------

.  
.          * Baseline no interaction model
.          xi:mixed x1polar attack $cvar $dvar || surveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  60996.822  
Iteration 1:  Log likelihood =  60996.822  

Computing standard errors ...

Mixed-effects ML regression                         Number of obs    = 133,457
Group variable: surveyid                            Number of groups =     124
                                                    Obs per group:
                                                                 min =     161
                                                                 avg = 1,076.3
                                                                 max =   3,632
                                                    Wald chi2(18)    = 4740.75
Log likelihood =  60996.822                         Prob > chi2      =  0.0000

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |   .0242999   .0101188     2.40   0.016     .0044674    .0441324
           ld |  -.0142245   .0065967    -2.16   0.031    -.0271538   -.0012952
        ivdem |  -.0092547   .0879514    -0.11   0.916    -.1816363    .1631269
         ijud |   .1431707   .0685386     2.09   0.037     .0088374    .2775039
   leftselfid |   .0550374   .0011526    47.75   0.000     .0527784    .0572964
  rightselfid |   .0532375   .0010064    52.90   0.000      .051265    .0552101
          age |   .0005235   .0000279    18.79   0.000     .0004689    .0005781
       female |   .0029404   .0008581     3.43   0.001     .0012586    .0046221
     employed |  -.0041375   .0010192    -4.06   0.000    -.0061351   -.0021398
        union |   -.002985   .0010854    -2.75   0.006    -.0051123   -.0008577
   _Iincome_1 |  -.0008721   .0010049    -0.87   0.385    -.0028416    .0010974
   _Iincome_9 |   .0040117    .001322     3.03   0.002     .0014206    .0066028
    _Iurban_1 |  -.0007071    .000991    -0.71   0.476    -.0026494    .0012352
    _Iurban_8 |   -.018026   .0196306    -0.92   0.358    -.0565013    .0204494
    _Iurban_9 |   .0135995   .0051009     2.67   0.008     .0036019    .0235971
_Ieducation_1 |  -.0083313   .0011707    -7.12   0.000    -.0106258   -.0060369
_Ieducation_2 |  -.0141279   .0011926   -11.85   0.000    -.0164653   -.0117905
_Ieducation_9 |  -.0116827   .0039606    -2.95   0.003    -.0194455     -.00392
        _cons |   .4724116   .0606133     7.79   0.000     .3536118    .5912114
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |    .002855    .000369      .0022161    .0036782
-----------------------------+------------------------------------------------
               var(Residual) |   .0233672   .0000905      .0231905    .0235453
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 10400.10      Prob >= chibar2 = 0.0000

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0242999   .0101188     2.40   0.016     .0044674    .0441324
------------------------------------------------------------------------------

.          est store polar1

.          
.          * Show that (macro) ruling party personalism boosts attacks in this samp
> le *
.          egen stag = tag(surveyid) if e(sample)==1

.          krls attack persparty if stag==1
Iteration =  1, Looloss: 78.86002  
Iteration =  2, Looloss: 77.85104  
Iteration =  3, Looloss: 76.9683   
Iteration =  4, Looloss: 76.26244  
Iteration =  5, Looloss: 75.74966  
Iteration =  6, Looloss: 75.43647  

Pointwise Derivatives                                   Number of obs =      124 
                                                        Lambda        =     3.01 
                                                        Tolerance     =     .124 
                                                        Sigma         =        1 
                                                        Eff. df       =    4.524 
                                                        R2            =      .16 
                                                        Looloss       =    75.31

    attack |      Avg.       SE        t    P>|t|        P25       P50       P75   
>     
-----------+--------------------------------------------------------------------
 persparty |  1.14282   .264304    4.324    0.000   -.042028   1.30414   2.45501  
-----------+--------------------------------------------------------------------


.          krls attack persparty ld ivdem year ijud if stag==1
Iteration =  1, Looloss: 70.15646  
Iteration =  2, Looloss: 65.39823  
Iteration =  3, Looloss: 60.05867  
Iteration =  4, Looloss: 54.58422  
Iteration =  5, Looloss: 49.45301  
Iteration =  6, Looloss: 44.99554  
Iteration =  7, Looloss: 41.30404  
Iteration =  8, Looloss: 38.28992  
Iteration =  9, Looloss: 35.80969  
Iteration = 10, Looloss: 33.74506  
Iteration = 11, Looloss: 32.02261  
Iteration = 12, Looloss: 30.61551  
Iteration = 13, Looloss: 29.5299   
Iteration = 14, Looloss: 28.76736  
Iteration = 15, Looloss: 28.29204  
Iteration = 16, Looloss: 28.03244  

Pointwise Derivatives                                   Number of obs =      124 
                                                        Lambda        =   .06816 
                                                        Tolerance     =     .124 
                                                        Sigma         =        5 
                                                        Eff. df       =       48 
                                                        R2            =    .9054 
                                                        Looloss       =    27.86

    attack |      Avg.       SE        t    P>|t|        P25       P50       P75   
>     
-----------+--------------------------------------------------------------------
 persparty |  .699878   .155331    4.506    0.000   -.304057   .372906   1.24778  
        ld |  -.08543   .043222   -1.977    0.050   -.228368  -.045527   .084891  
     ivdem |  -1.7604   .712977   -2.469    0.015   -3.70294  -1.79089   .493455  
      year |  .014647   .004716    3.106    0.002   -.005754   .012769   .028933  
      ijud | -1.82705   .636416   -2.871    0.005   -4.20581  -1.70525   .674085  
-----------+--------------------------------------------------------------------


.          local var = "i_pop ipolar ipi pres"

.          foreach v of local var {
  2.                 krls attack persparty ld ivdem year ijud `v' if stag==1
  3.          }
Iteration =  1, Looloss: 70.6896   
Iteration =  2, Looloss: 66.25186  
Iteration =  3, Looloss: 61.19699  
Iteration =  4, Looloss: 55.89787  
Iteration =  5, Looloss: 50.78413  
Iteration =  6, Looloss: 46.186    
Iteration =  7, Looloss: 42.23724  
Iteration =  8, Looloss: 38.91919  
Iteration =  9, Looloss: 36.17753  
Iteration = 10, Looloss: 33.98235  
Iteration = 11, Looloss: 32.306    
Iteration = 12, Looloss: 31.08932  
Iteration = 13, Looloss: 30.24429  
Iteration = 14, Looloss: 29.68272  
Iteration = 15, Looloss: 29.33581  

Pointwise Derivatives                                    Number of obs =      123 
                                                         Lambda        =   .08023 
                                                         Tolerance     =     .123 
                                                         Sigma         =        6 
                                                         Eff. df       =    55.25 
                                                         R2            =    .9334 
                                                         Looloss       =    29.07

     attack |      Avg.       SE        t    P>|t|        P25       P50       P75  
>      
------------+--------------------------------------------------------------------
  persparty |  .447234    .12342    3.624    0.000   -.582623   .229346   1.29771  
         ld | -.044651    .03062   -1.458    0.147   -.201126  -.060879   .100134  
      ivdem | -2.02307   .557104   -3.631    0.000   -3.45437  -1.50168   .343951  
       year |  .009173   .003733    2.457    0.015   -.005016   .007834   .018304  
       ijud |  -2.2602   .484962   -4.661    0.000   -4.92247  -2.28338   .398686  
 i_populism | -.031398   .111354   -0.282    0.778   -.835952   .044739   .630725  
------------+--------------------------------------------------------------------

Iteration =  1, Looloss: 68.08584  
Iteration =  2, Looloss: 62.95073  
Iteration =  3, Looloss: 57.22148  
Iteration =  4, Looloss: 51.47431  
Iteration =  5, Looloss: 46.26691  
Iteration =  6, Looloss: 41.89145  
Iteration =  7, Looloss: 38.32835  
Iteration =  8, Looloss: 35.40565  
Iteration =  9, Looloss: 32.98215  
Iteration = 10, Looloss: 31.01073  
Iteration = 11, Looloss: 29.48894  
Iteration = 12, Looloss: 28.39319  
Iteration = 13, Looloss: 27.66022  
Iteration = 14, Looloss: 27.20609  
Iteration = 15, Looloss: 26.94807  

Pointwise Derivatives                                   Number of obs =      120 
                                                        Lambda        =   .07939 
                                                        Tolerance     =      .12 
                                                        Sigma         =        6 
                                                        Eff. df       =    54.21 
                                                        R2            =    .9339 
                                                        Looloss       =    26.76

    attack |      Avg.       SE        t    P>|t|        P25       P50       P75   
>     
-----------+--------------------------------------------------------------------
 persparty |  .604957   .120625    5.015    0.000   -.257944   .460522   1.22032  
        ld |  -.08224   .030848   -2.666    0.009   -.261384  -.047099   .111691  
     ivdem | -1.27263   .533988   -2.383    0.019   -3.00156  -.916156    .40345  
      year |  .014824   .003724    3.981    0.000   -.007121   .013372   .033744  
      ijud | -.561472    .49255   -1.140    0.257   -1.62821  -.766667   .629911  
    ipolar |  .108315   .019508    5.552    0.000   -.034507   .076895    .26501  
-----------+--------------------------------------------------------------------

Iteration =  1, Looloss: 70.89992  
Iteration =  2, Looloss: 66.57675  
Iteration =  3, Looloss: 61.70509  
Iteration =  4, Looloss: 56.57754  
Iteration =  5, Looloss: 51.49957  
Iteration =  6, Looloss: 46.69573  
Iteration =  7, Looloss: 42.28095  
Iteration =  8, Looloss: 38.3176   
Iteration =  9, Looloss: 34.88582  
Iteration = 10, Looloss: 32.07495  
Iteration = 11, Looloss: 29.91488  
Iteration = 12, Looloss: 28.34813  
Iteration = 13, Looloss: 27.2662   
Iteration = 14, Looloss: 26.55282  
Iteration = 15, Looloss: 26.10329  
Iteration = 16, Looloss: 25.8307   
Iteration = 17, Looloss: 25.6694   

Pointwise Derivatives                                   Number of obs =      124 
                                                        Lambda        =    .1111 
                                                        Tolerance     =     .124 
                                                        Sigma         =        6 
                                                        Eff. df       =    44.91 
                                                        R2            =    .9044 
                                                        Looloss       =    25.52

    attack |      Avg.       SE        t    P>|t|        P25       P50       P75   
>     
-----------+--------------------------------------------------------------------
 persparty |   .51044   .138848    3.676    0.000   -.161043   .429526   .922315  
        ld | -.042115   .036229   -1.162    0.247   -.148171  -.044922   .069519  
     ivdem | -1.72834   .577281   -2.994    0.003   -2.67016  -1.06083   .093969  
      year |  .007659   .004159    1.842    0.068    -.00414   .005199   .015726  
      ijud | -1.85313   .560138   -3.308    0.001   -3.16505  -2.25207  -.737991  
       ipi | -.779423   .394643   -1.975    0.051   -1.69005    -1.153   .275655  
-----------+--------------------------------------------------------------------

Iteration =  1, Looloss: 71.93083  
Iteration =  2, Looloss: 67.58221  
Iteration =  3, Looloss: 62.48954  
Iteration =  4, Looloss: 56.9775   
Iteration =  5, Looloss: 51.50163  
Iteration =  6, Looloss: 46.50628  
Iteration =  7, Looloss: 42.25861  
Iteration =  8, Looloss: 38.78895  
Iteration =  9, Looloss: 35.97699  
Iteration = 10, Looloss: 33.68283  
Iteration = 11, Looloss: 31.82126  
Iteration = 12, Looloss: 30.36739  
Iteration = 13, Looloss: 29.32287  
Iteration = 14, Looloss: 28.67148  

Pointwise Derivatives                                   Number of obs =      124 
                                                        Lambda        =   .09891 
                                                        Tolerance     =     .124 
                                                        Sigma         =        6 
                                                        Eff. df       =    48.83 
                                                        R2            =     .912 
                                                        Looloss       =    28.27

    attack |      Avg.       SE        t    P>|t|        P25       P50       P75   
>     
-----------+--------------------------------------------------------------------
 persparty |   .86926   .136847    6.352    0.000    .233193   .530365   1.09773  
        ld | -.037271   .035612   -1.047    0.297   -.143231    -.0226   .085029  
     ivdem |  -2.6907   .525753   -5.118    0.000   -4.15302  -2.77395  -1.37764  
      year |  .016919   .003955    4.278    0.000   -.005364    .00992   .035457  
      ijud | -1.15327   .503189   -2.292    0.024   -2.79161  -1.30545   .572074  
     *pres | -.137601   .066147   -2.080    0.040   -.376264  -.180061   .043816  
-----------+--------------------------------------------------------------------
* average dy/dx is the first difference using the min and max (i.e. usually 0 to 1)

.  
.          * Basline interaction model *
.          xi:mixed x1polar attack persparty pXa $cvar $dvar || surveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  61004.797  
Iteration 1:  Log likelihood =  61004.797  

Computing standard errors ...

Mixed-effects ML regression                         Number of obs    = 133,457
Group variable: surveyid                            Number of groups =     124
                                                    Obs per group:
                                                                 min =     161
                                                                 avg = 1,076.3
                                                                 max =   3,632
                                                    Wald chi2(20)    = 4760.54
Log likelihood =  61004.797                         Prob > chi2      =  0.0000

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |    -.04889   .0219628    -2.23   0.026    -.0919364   -.0058437
    persparty |  -.1687619   .0445847    -3.79   0.000    -.2561463   -.0813775
          pXa |    .145376   .0368639     3.94   0.000     .0731242    .2176279
           ld |  -.0241103   .0068419    -3.52   0.000    -.0375201   -.0107005
        ivdem |  -.0077611   .0880512    -0.09   0.930    -.1803382     .164816
         ijud |   .1579261   .0662652     2.38   0.017     .0280486    .2878035
   leftselfid |   .0550205   .0011526    47.74   0.000     .0527615    .0572795
  rightselfid |   .0532228   .0010064    52.88   0.000     .0512503    .0551954
          age |   .0005239   .0000279    18.81   0.000     .0004693    .0005785
       female |   .0029423   .0008581     3.43   0.001     .0012605     .004624
     employed |   -.004138   .0010191    -4.06   0.000    -.0061354   -.0021405
        union |  -.0030035   .0010853    -2.77   0.006    -.0051307   -.0008764
   _Iincome_1 |  -.0008787   .0010048    -0.87   0.382    -.0028481    .0010908
   _Iincome_9 |   .0040596   .0013218     3.07   0.002     .0014688    .0066503
    _Iurban_1 |  -.0007295    .000991    -0.74   0.462    -.0026718    .0012128
    _Iurban_8 |  -.0181347   .0196305    -0.92   0.356    -.0566097    .0203404
    _Iurban_9 |   .0141934   .0050719     2.80   0.005     .0042527    .0241342
_Ieducation_1 |  -.0083362   .0011706    -7.12   0.000    -.0106305   -.0060419
_Ieducation_2 |   -.014108   .0011925   -11.83   0.000    -.0164453   -.0117708
_Ieducation_9 |  -.0117552   .0039603    -2.97   0.003    -.0195172   -.0039931
        _cons |   .5695278   .0615777     9.25   0.000     .4488377    .6902178
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0025081   .0003245      .0019463     .003232
-----------------------------+------------------------------------------------
               var(Residual) |   .0233672   .0000905      .0231905    .0235453
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 9022.03       Prob >= chibar2 = 0.0000

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    -.04889   .0219628    -2.23   0.026    -.0919364   -.0058437
------------------------------------------------------------------------------

.                  lincom pXa

 ( 1)  [x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .145376   .0368639     3.94   0.000     .0731242    .2176279
------------------------------------------------------------------------------

.                  lincom attack + pXa*.18

 ( 1)  [x1polar]attack + .18*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0227223   .0163413    -1.39   0.164    -.0547507     .009306
------------------------------------------------------------------------------

.                  lincom attack + pXa*.70

 ( 1)  [x1polar]attack + .7*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0528732   .0118168     4.47   0.000     .0297127    .0760336
------------------------------------------------------------------------------

.          est store polar2

.                         
.                                         * Robust to specification changes *
.                                  xi:mixed x1polar attack persparty pXa || surveyi
> d:

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  59974.661  
Iteration 1:  Log likelihood =  59974.661  

Computing standard errors ...

Mixed-effects ML regression                         Number of obs    = 136,439
Group variable: surveyid                            Number of groups =     126
                                                    Obs per group:
                                                                 min =     165
                                                                 avg = 1,082.8
                                                                 max =   3,667
                                                    Wald chi2(3)     =   16.64
Log likelihood =  59974.661                         Prob > chi2      =  0.0008

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
      attack |  -.0387192   .0204882    -1.89   0.059    -.0788753    .0014368
   persparty |   -.107752    .042995    -2.51   0.012    -.1920205   -.0234834
         pXa |   .1167635   .0378426     3.09   0.002     .0425933    .1909337
       _cons |   .6385681   .0193484    33.00   0.000     .6006458    .6764903
------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0029212   .0003727      .0022749     .003751
-----------------------------+------------------------------------------------
               var(Residual) |   .0241994   .0000927      .0240184    .0243818
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 11731.95      Prob >= chibar2 = 0.0000

.                                  xi:mixed x1polar attack persparty pXa $cvar || s
> urveyid:

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  58971.793  
Iteration 1:  Log likelihood =  58971.793  

Computing standard errors ...

Mixed-effects ML regression                         Number of obs    = 134,270
Group variable: surveyid                            Number of groups =     124
                                                    Obs per group:
                                                                 min =     165
                                                                 avg = 1,082.8
                                                                 max =   3,667
                                                    Wald chi2(6)     =   35.66
Log likelihood =  58971.793                         Prob > chi2      =  0.0000

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
      attack |  -.0527561   .0222163    -2.37   0.018    -.0962992   -.0092129
   persparty |   -.166133   .0450619    -3.69   0.000    -.2544527   -.0778134
         pXa |   .1523469   .0372722     4.09   0.000     .0792946    .2253992
          ld |  -.0242487    .006913    -3.51   0.000    -.0377978   -.0106995
       ivdem |  -.0082442   .0891237    -0.09   0.926    -.1829235    .1664351
        ijud |   .1679798   .0670742     2.50   0.012     .0365167    .2994429
       _cons |   .6062942   .0622749     9.74   0.000     .4842377    .7283506
------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0025702   .0003314      .0019963    .0033092
-----------------------------+------------------------------------------------
               var(Residual) |   .0242201   .0000935      .0240375    .0244041
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 9570.87       Prob >= chibar2 = 0.0000

.                                  xi:mixed x1polar attack persparty pXa $dvar || s
> urveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  62042.827  
Iteration 1:  Log likelihood =  62042.827  

Computing standard errors ...

Mixed-effects ML regression                         Number of obs    = 135,624
Group variable: surveyid                            Number of groups =     126
                                                    Obs per group:
                                                                 min =     161
                                                                 avg = 1,076.4
                                                                 max =   3,632
                                                    Wald chi2(17)    = 4811.29
Log likelihood =  62042.827                         Prob > chi2      =  0.0000

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |  -.0338227   .0201999    -1.67   0.094    -.0734138    .0057684
    persparty |  -.1095965   .0424055    -2.58   0.010    -.1927098   -.0264832
          pXa |   .1095757   .0373207     2.94   0.003     .0364285    .1827229
   leftselfid |   .0550663   .0011392    48.34   0.000     .0528335    .0572992
  rightselfid |   .0531712   .0009999    53.18   0.000     .0512114     .055131
          age |   .0005267   .0000276    19.06   0.000     .0004726    .0005809
       female |   .0028176   .0008509     3.31   0.001     .0011499    .0044853
     employed |  -.0039612   .0010093    -3.92   0.000    -.0059394   -.0019829
        union |  -.0027729   .0010724    -2.59   0.010    -.0048747    -.000671
   _Iincome_1 |  -.0008158   .0009958    -0.82   0.413    -.0027676    .0011359
   _Iincome_9 |   .0042056    .001314     3.20   0.001     .0016302     .006781
    _Iurban_1 |   -.000535   .0009807    -0.55   0.585    -.0024572    .0013872
    _Iurban_8 |  -.0180566   .0196226    -0.92   0.357    -.0565162    .0204029
    _Iurban_9 |   .0142879   .0050712     2.82   0.005     .0043485    .0242274
_Ieducation_1 |  -.0081339   .0011595    -7.01   0.000    -.0104065   -.0058613
_Ieducation_2 |   -.014055   .0011796   -11.91   0.000    -.0163671    -.011743
_Ieducation_9 |   -.011443   .0039402    -2.90   0.004    -.0191656   -.0037204
        _cons |   .5921598   .0191937    30.85   0.000     .5545409    .6297787
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0028382   .0003637      .0022079    .0036486
-----------------------------+------------------------------------------------
               var(Residual) |   .0233482   .0000897       .023173    .0235246
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 10812.02      Prob >= chibar2 = 0.0000

.                                          * Robust to changing unit hetero *
.                                  xi:reg x1polar attack persparty pXa $cvar $dvar
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

      Source |       SS           df       MS      Number of obs   =   133,457
-------------+----------------------------------   F(20, 133436)   =    477.13
       Model |   239.64998        20   11.982499   Prob > F        =    0.0000
    Residual |  3351.07369   133,436  .025113715   R-squared       =    0.0667
-------------+----------------------------------   Adj R-squared   =    0.0666
       Total |  3590.72367   133,456  .026905674   Root MSE        =    .15847

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |  -.0325977   .0022539   -14.46   0.000    -.0370152   -.0281802
    persparty |  -.1485265   .0040889   -36.32   0.000    -.1565406   -.1405124
          pXa |   .1244442   .0037249    33.41   0.000     .1171436    .1317449
           ld |  -.0204406   .0007059   -28.96   0.000    -.0218242    -.019057
        ivdem |  -.0848603   .0089652    -9.47   0.000    -.1024319   -.0672887
         ijud |   .2338071   .0069263    33.76   0.000     .2202317    .2473826
   leftselfid |   .0568601   .0011668    48.73   0.000     .0545732    .0591469
  rightselfid |   .0524992   .0010149    51.73   0.000       .05051    .0544884
          age |    .000742   .0000276    26.93   0.000      .000688     .000796
       female |   .0051546   .0008848     5.83   0.000     .0034203    .0068888
     employed |   .0023257   .0009794     2.37   0.018     .0004061    .0042452
        union |    -.00787   .0010387    -7.58   0.000    -.0099059   -.0058341
   _Iincome_1 |  -.0028354   .0010278    -2.76   0.006    -.0048499   -.0008208
   _Iincome_9 |    .012975   .0012399    10.46   0.000     .0105448    .0154052
    _Iurban_1 |  -.0038923   .0009666    -4.03   0.000    -.0057867   -.0019978
    _Iurban_8 |  -.0502648   .0201471    -2.49   0.013    -.0897528   -.0107767
    _Iurban_9 |  -.0140234   .0013428   -10.44   0.000    -.0166552   -.0113917
_Ieducation_1 |   -.005428   .0011362    -4.78   0.000    -.0076548   -.0032012
_Ieducation_2 |  -.0099658   .0011354    -8.78   0.000    -.0121911   -.0077404
_Ieducation_9 |  -.0133774   .0038674    -3.46   0.001    -.0209574   -.0057974
        _cons |   .5261882    .006884    76.44   0.000     .5126956    .5396807
-------------------------------------------------------------------------------

.                                  xi:reg x1polar i.year attack persparty pXa $cvar
>  $dvar
i.year            _Iyear_1996-2016    (naturally coded; _Iyear_1996 omitted)
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

      Source |       SS           df       MS      Number of obs   =   133,457
-------------+----------------------------------   F(40, 133416)   =    295.69
       Model |  292.406455        40  7.31016139   Prob > F        =    0.0000
    Residual |  3298.31722   133,416  .024722051   R-squared       =    0.0814
-------------+----------------------------------   Adj R-squared   =    0.0812
       Total |  3590.72367   133,456  .026905674   Root MSE        =    .15723

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
--------------+----------------------------------------------------------------
  _Iyear_1997 |    .037082   .0030086    12.33   0.000     .0311851    .0429788
  _Iyear_1998 |   .0375537   .0028188    13.32   0.000      .032029    .0430785
  _Iyear_1999 |   .0390922   .0031833    12.28   0.000      .032853    .0453315
  _Iyear_2000 |  -.0134109   .0045896    -2.92   0.003    -.0224064   -.0044154
  _Iyear_2001 |   .0695184   .0032675    21.28   0.000     .0631142    .0759225
  _Iyear_2002 |   .0074898   .0022721     3.30   0.001     .0030366     .011943
  _Iyear_2003 |   .0140232    .002862     4.90   0.000     .0084137    .0196327
  _Iyear_2004 |   .0081658   .0030422     2.68   0.007     .0022032    .0141284
  _Iyear_2005 |   .0193327   .0024913     7.76   0.000     .0144499    .0242155
  _Iyear_2006 |   .0001876   .0027422     0.07   0.945     -.005187    .0055623
  _Iyear_2007 |   .0226435   .0024876     9.10   0.000     .0177679     .027519
  _Iyear_2008 |   .0393271   .0026686    14.74   0.000     .0340967    .0445576
  _Iyear_2009 |   .0344853   .0023468    14.69   0.000     .0298857    .0390849
  _Iyear_2010 |  -.0078572   .0030865    -2.55   0.011    -.0139067   -.0018077
  _Iyear_2011 |   .0623624   .0025158    24.79   0.000     .0574314    .0672933
  _Iyear_2012 |   .0342645   .0026209    13.07   0.000     .0291276    .0394013
  _Iyear_2013 |   .0263324   .0023935    11.00   0.000     .0216412    .0310236
  _Iyear_2014 |   .0423728   .0028142    15.06   0.000     .0368571    .0478886
  _Iyear_2015 |   .0535144   .0027229    19.65   0.000     .0481776    .0588511
  _Iyear_2016 |  -.0335568   .0039124    -8.58   0.000     -.041225   -.0258886
       attack |  -.0546632   .0024747   -22.09   0.000    -.0595136   -.0498127
    persparty |  -.1660615   .0045321   -36.64   0.000    -.1749444   -.1571787
          pXa |   .1516912    .003963    38.28   0.000     .1439238    .1594586
           ld |   -.021582   .0007433   -29.04   0.000    -.0230388   -.0201252
        ivdem |  -.0499781   .0093526    -5.34   0.000    -.0683089   -.0316472
         ijud |   .1888297   .0076549    24.67   0.000     .1738263    .2038331
   leftselfid |   .0574408   .0011633    49.38   0.000     .0551607    .0597208
  rightselfid |   .0528755   .0010125    52.22   0.000     .0508911    .0548599
          age |   .0006825   .0000276    24.72   0.000     .0006284    .0007366
       female |    .005033    .000879     5.73   0.000     .0033101    .0067559
     employed |   .0028633   .0009921     2.89   0.004     .0009188    .0048079
        union |  -.0082559   .0010545    -7.83   0.000    -.0103227   -.0061891
   _Iincome_1 |  -.0022876   .0010223    -2.24   0.025    -.0042912   -.0002839
   _Iincome_9 |   .0115611   .0012499     9.25   0.000     .0091113     .014011
    _Iurban_1 |  -.0022012   .0009693    -2.27   0.023     -.004101   -.0003015
    _Iurban_8 |   -.043673   .0200136    -2.18   0.029    -.0828992   -.0044468
    _Iurban_9 |  -.0260682   .0015169   -17.18   0.000    -.0290414   -.0230951
_Ieducation_1 |  -.0080878   .0011382    -7.11   0.000    -.0103186    -.005857
_Ieducation_2 |  -.0141514   .0011471   -12.34   0.000    -.0163998    -.011903
_Ieducation_9 |  -.0097988   .0038937    -2.52   0.012    -.0174305   -.0021672
        _cons |   .5367731   .0072678    73.86   0.000     .5225284    .5510178
-------------------------------------------------------------------------------

.                                  xi:interflex x1polar  attack persparty $cvar $dv
> ar,fe(country)nbin(4)cut(.3 .5 .625)  /* 35%,23%,17%,20% */
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)
Fixed effects included; clustered standard errors highly recommended
p value of Wald test: 0.0000

.                                  mat list r(estBin)

r(estBin)[4,5]
            x0    bin_marg      bin_se    bin_CI_l    bin_CI_u
r1   .21162806  -.00426768   .00743201  -.01883415    .0102988
r2   .42101812   .03417635   .00592257   .02256832   .04578437
r3   .54492342   .02928931   .00574997   .01801958   .04055904
r4   .70238376   .05225346   .00473892   .04296534   .06154159

.                                  erase .pdf

.          
.          * Interaction model but exclude respondents who recently selected into p
> arties *
.          xi:mixed x1polar attack persparty pXa $cvar $dvar if newvoter==0 & votes
> witch==0 || surveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  34617.071  
Iteration 1:  Log likelihood =  34617.071  

Computing standard errors ...

Mixed-effects ML regression                         Number of obs    =  76,804
Group variable: surveyid                            Number of groups =     105
                                                    Obs per group:
                                                                 min =      40
                                                                 avg =   731.5
                                                                 max =   2,572
                                                    Wald chi2(20)    = 2811.91
Log likelihood =  34617.071                         Prob > chi2      =  0.0000

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |  -.0457696   .0228853    -2.00   0.046     -.090624   -.0009152
    persparty |  -.1662765   .0464049    -3.58   0.000    -.2572285   -.0753246
          pXa |   .1437758   .0374919     3.83   0.000      .070293    .2172585
           ld |  -.0236692   .0075168    -3.15   0.002    -.0384017   -.0089366
        ivdem |   .0172993   .0884627     0.20   0.845    -.1560845     .190683
         ijud |   .1963631   .0697819     2.81   0.005     .0595932     .333133
   leftselfid |   .0530846   .0015363    34.55   0.000     .0500735    .0560958
  rightselfid |   .0554985   .0013293    41.75   0.000     .0528931     .058104
          age |   .0005922   .0000372    15.91   0.000     .0005192    .0006651
       female |   .0033435   .0011367     2.94   0.003     .0011157    .0055713
     employed |  -.0027001   .0013587    -1.99   0.047    -.0053632    -.000037
        union |  -.0037187   .0014632    -2.54   0.011    -.0065866   -.0008509
   _Iincome_1 |   .0004945    .001354     0.37   0.715    -.0021593    .0031482
   _Iincome_9 |   .0042194   .0016939     2.49   0.013     .0008994    .0075393
    _Iurban_1 |  -.0033571   .0013059    -2.57   0.010    -.0059166   -.0007977
    _Iurban_8 |  -.0307923   .0217911    -1.41   0.158     -.073502    .0119174
    _Iurban_9 |   .0084675   .0063926     1.32   0.185    -.0040618    .0209967
_Ieducation_1 |  -.0079852   .0015547    -5.14   0.000    -.0110323   -.0049381
_Ieducation_2 |  -.0145268   .0016064    -9.04   0.000    -.0176753   -.0113783
_Ieducation_9 |  -.0107877   .0048942    -2.20   0.028    -.0203801   -.0011953
        _cons |   .5200337   .0677647     7.67   0.000     .3872172    .6528501
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0024124   .0003483      .0018178    .0032015
-----------------------------+------------------------------------------------
               var(Residual) |   .0236346   .0001207      .0233992    .0238723
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 5305.16       Prob >= chibar2 = 0.0000

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0457696   .0228853    -2.00   0.046     -.090624   -.0009152
------------------------------------------------------------------------------

.                  lincom pXa

 ( 1)  [x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1437758   .0374919     3.83   0.000      .070293    .2172585
------------------------------------------------------------------------------

.                  lincom attack + pXa*.18

 ( 1)  [x1polar]attack + .18*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    -.01989   .0171727    -1.16   0.247    -.0535479     .013768
------------------------------------------------------------------------------

.                  lincom attack + pXa*.70        

 ( 1)  [x1polar]attack + .7*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0548734   .0120615     4.55   0.000     .0312333    .0785135
------------------------------------------------------------------------------

.          est store polar3

.          
.          label var attack "State attack{sub:c,y}"

.          label var persparty `""Ruling party  " "personalism{sub:c,y}""'

.          label var pXa  `""Attack x Ruling     " "party personalism{sub:c,y}""'

.          label var pers `""Personalist   " "party voter{sub:i,c,y}""'

.          label var leftself "Left self-id{sub:i,c,y}"

.          label var rightself "Right self-id{sub:i,c,y}"

.  
.          coefplot(polar1, msymbol(O))(polar2, msymbol(T))(polar3, msymbol(s)),  /
> //
>                 drop(_cons ijud ld ivdem ipolar age female married employed union
>  i.income i.urban i.education _I*)  ///
>                 order(attack pXa persparty  pers leftself rightself newvoter vote
> switcher) ///
>                 grid(glcolor(gs15))xline(0,lpattern(dash)) xlab(-.2(.1).2)  ///
>                 xtitle(Coefficient estimates)  level(95 90) ///
>                 title("Citizen polarization",size(medium)height(6)) ///
>                 subtit("Comparative Study of Electoral Systems, 1996-2016",pos(6)
> size(small))xsize(2)ysize(3) mlabel format(%9.2g) ///
>                 mlabsize(vsmall)mlabposition(2)mlabgap(*.65) ///
>                 legend(lab(3 "No interaction") lab(6 "Interaction") lab(9 "Exclud
> e new voters" "& party switchers") ///
>                 pos(6)ring(1)col(3)order(3 6 9)) 

.          gr export "$dir\golden\Ch6-Micro-Polarization-estimates.pdf",as(pdf)repl
> ace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\C
    > h6-Micro-Polarization-estimates.pdf saved as PDF format

. 
.  * Binning estimates *
.         global dvar="leftself rightself age female married employed union i.incom
> e i.urban i.education"

.         global d = "attack"

.         gen beta=.
(136,439 missing values generated)

.         gen hi=.
(136,439 missing values generated)

.         gen lo=.
(136,439 missing values generated)

.         gen v=""
(136,439 missing values generated)

.         gen n=_n

.         capture program drop myplot

.         program define myplot
  1.                 local var = "attack leftself rightself"
  2.                 local i=1
  3.                 foreach v of local var {
  4.                         margins,dydx(`v')
  5.                         local b =r(table)[1,1] 
  6.                         local l =r(table)[5,1] 
  7.                         local u =r(table)[6,1] 
  8.                         replace beta=`b' if n==`i' + $r
  9.                         replace lo=`l' if n==`i' + $r
 10.                         replace hi=`u' if n==`i' + $r
 11.                         replace v="`v'" if n==`i' + $r
 12.                         local i=`i'+1
 13.                 }
 14. 
.         end

.         gen rb=round(beta,.001)
(136,439 missing values generated)

.         centile persparty if x1polar~=.,centile(50)

                                                          Binom. interp.   
    Variable |       Obs  Percentile    Centile        [95% conf. interval]
-------------+-------------------------------------------------------------
   persparty |   136,439         50    .4580351        .4580351    .4580351

.         global cut1 = r(c_1)

.         qui xi:mixed x1polar $d $cvar $dvar if persparty<$cut1 || surveyid:

.                 global r=0

.                 myplot

Average marginal effects                                Number of obs = 67,068

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  attack

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
      attack |  -.0148918   .0159606    -0.93   0.351    -.0461741    .0163905
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
variable v was str1 now str6
(1 real change made)

Average marginal effects                                Number of obs = 67,068

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  leftselfid

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
  leftselfid |   .0566075    .001641    34.50   0.000     .0533912    .0598237
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
variable v was str6 now str8
(1 real change made)

Average marginal effects                                Number of obs = 67,068

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  rightselfid

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
 rightselfid |   .0564693   .0014104    40.04   0.000      .053705    .0592335
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
variable v was str8 now str9
(1 real change made)

.         qui xi:mixed x1polar $d $cvar $dvar if persparty>=$cut1 || surveyid:

.                 global r=5

.                 myplot

Average marginal effects                                Number of obs = 66,389

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  attack

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
      attack |   .0454665   .0139841     3.25   0.001     .0180582    .0728748
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)

Average marginal effects                                Number of obs = 66,389

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  leftselfid

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
  leftselfid |   .0533251   .0016212    32.89   0.000     .0501477    .0565026
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)

Average marginal effects                                Number of obs = 66,389

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  rightselfid

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
 rightselfid |   .0501812   .0014377    34.90   0.000     .0473634     .052999
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)

.         centile attack if  x1polar~=.,centile(10 90) /* moving from low (10pctile
> ) to high (90pctile) attack on judiciary is 1.5 units */

                                                          Binom. interp.   
    Variable |       Obs  Percentile    Centile        [95% conf. interval]
-------------+-------------------------------------------------------------
      attack |   136,439         10    .2146966        .2146966    .2146966
             |                   90    1.655651        1.655651    1.668686

.         twoway  (scatter beta n if n==1 ,mlab(rb)msym(O)mcol(gs1)legend(lab(1 "At
> tack on the state")  ///
>                 lab(3 "Left self-ideology")lab(5 "Right self-ideology")  order(1 
> 3 5)pos(6)ring(0)))  ///
>                 (rspike hi lo n if n==1,lcol(gs1)lwidth(thin))  (scatter beta n i
> f n==2 ,mlab(rb)msym(S)mcol(gs10) ///
>                 yscale(range(-.047 .073)) xla(.5 " "  ,nogrid nolabels) xtit("57 
> surveys in 25 countries",size(small)) ///
>                 ytit("Marginal effect on polarization",size(small))ylab(-.04(.04)
> .08) xscale(range(0.5 3.5)) ///
>                 tit("Non-personalist ruling parties") )   (rspike hi lo n if n==3
> ,lcol(gs10)lwidth(thin)yline(0)) ///
>                 (scatter beta n if n==3,mcol(gs10)msym(T)saving(h1.gph,replace)ml
> ab(rb)) ///
>                 (rspike hi lo n if n==2,lcol(gs10)lwidth(thin)yline(0))
file h1.gph saved

.         twoway  (scatter beta n if n==6 ,mlab(rb)msym(O)mcol(gs1)legend(lab(1 "At
> tack on the state")  ///
>                 lab(3 "Left self-ideology")lab(5 "Right self-ideology")  order(1 
> 3 5)pos(6)ring(0)))  ///
>                 (rspike hi lo n if n==6,lcol(gs1)lwidth(thin))  (scatter beta n i
> f n==7 ,mlab(rb)msym(S)mcol(gs10) ///
>                 yscale(range(-.047 .073)) xla(5.5 " "  ,nogrid nolabels) xtit("67
>  surveys in 34 countries",size(small)) ///
>                 ytit("Marginal effect on polarization",size(small))ylab(-.04(.04)
> .08) xscale(range(5.5 8.5)) ///
>                 tit("{bf:Personalist} ruling parties") )   (rspike hi lo n if n==
> 7,lcol(gs10)lwidth(thin)yline(0)) ///
>                 (scatter beta n if n==8,mcol(gs10)msym(T)saving(h2.gph,replace)ml
> ab(rb)) ///
>                 (rspike hi lo n if n==8,lcol(gs10)lwidth(thin)yline(0))
file h2.gph saved

.         gr combine h1.gph h2.gph,col(2) tit(Micro-polarization)

.         gr export "$dir\golden\Ch6-Micro-Polarization-bins.pdf",as(pdf)replace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\C
    > h6-Micro-Polarization-bins.pdf saved as PDF format

.         drop n beta hi lo v rb

.         
.         * Check with different two-bin cutpoint *
.          qui xi:mixed x1polar $d $cvar $dvar if persparty<.5 || surveyid:

.          lincom $d

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0023062   .0130338    -0.18   0.860    -.0278521    .0232396
------------------------------------------------------------------------------

.          qui xi:mixed x1polar $d $cvar $dvar if persparty>=.5 || surveyid:

.          lincom $d

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0439359   .0168053     2.61   0.009     .0109981    .0768736
------------------------------------------------------------------------------

.         
.         * Check with country fixed effects *
.          xtsum attack persparty if x1polar~=. & pers~=.,i(cowcode)

Variable         |      Mean   Std. dev.       Min        Max |    Observations
-----------------+--------------------------------------------+----------------
attack   overall |  .8081259   .6027679          0   4.128828 |     N =  127438
         between |             .7452779          0   3.527958 |     n =      47
         within  |             .1364914   .1955889   1.408995 | T-bar = 2711.45
                 |                                            |
perspa~y overall |  .4054411   .2009542          0   .8906565 |     N =  127438
         between |             .1825776   .1246345   .8906565 |     n =      47
         within  |             .0931981   .0451269   .6475669 | T-bar = 2711.45

.          xi:glm x1polar i.country attack persparty pXa $cvar $dvar,family(binomia
> l)link(clog)vce(cluster surveyid)
i.country         _Icountry_1-47      (_Icountry_1 for coun~y==Albania omitted)
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)
note: x1polar has noninteger values

Iteration 0:  Log pseudolikelihood = -61283.013  
Iteration 1:  Log pseudolikelihood = -61208.937  
Iteration 2:  Log pseudolikelihood = -61208.896  
Iteration 3:  Log pseudolikelihood = -61208.896  

Generalized linear models                         Number of obs   =    133,457
Optimization     : ML                             Residual df     =    133,402
                                                  Scale parameter =          1
Deviance         =  14847.04447                   (1/df) Deviance =   .1112955
Pearson          =  13506.60108                   (1/df) Pearson  =   .1012474

Variance function: V(u) = u*(1-u/1)               [Binomial]
Link function    : g(u) = ln(-ln(1-u))            [Complementary log-log]

                                                  AIC             =   .9181069
Log pseudolikelihood = -61208.89626               BIC             =   -1559501

                              (Std. err. adjusted for 124 clusters in surveyid)
-------------------------------------------------------------------------------
              |               Robust
      x1polar | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
  _Icountry_2 |  -.6877627   .1778177    -3.87   0.000    -1.036279   -.3392464
  _Icountry_3 |  -.8801189   .2361673    -3.73   0.000    -1.342998   -.4172396
  _Icountry_4 |  -.7804542   .2276727    -3.43   0.001    -1.226684    -.334224
  _Icountry_5 |  -.9346054   .2324265    -4.02   0.000    -1.390153   -.4790578
  _Icountry_6 |  -1.038855   .2358693    -4.40   0.000     -1.50115     -.57656
  _Icountry_7 |  -.2391545   .1445748    -1.65   0.098    -.5225158    .0442068
  _Icountry_8 |  -.7962652   .1982165    -4.02   0.000    -1.184762   -.4077681
  _Icountry_9 |  -1.059345    .245077    -4.32   0.000    -1.539687   -.5790033
 _Icountry_10 |   -.714304   .1763431    -4.05   0.000     -1.05993   -.3686779
 _Icountry_11 |  -.7767121    .247015    -3.14   0.002    -1.260852   -.2925717
 _Icountry_12 |  -.8419616   .2402111    -3.51   0.000    -1.312767   -.3711566
 _Icountry_13 |  -.8167384   .2353931    -3.47   0.001      -1.2781   -.3553764
 _Icountry_14 |  -.9509936   .2324504    -4.09   0.000    -1.406588   -.4953992
 _Icountry_15 |  -.9431016    .230159    -4.10   0.000    -1.394205   -.4919983
 _Icountry_16 |  -.8970258   .2475226    -3.62   0.000    -1.382161   -.4118903
 _Icountry_17 |  -.8286097   .2390711    -3.47   0.001     -1.29718   -.3600391
 _Icountry_18 |  -.6579477   .2323154    -2.83   0.005    -1.113278   -.2026178
 _Icountry_19 |  -.9335219   .2277806    -4.10   0.000    -1.379964   -.4870802
 _Icountry_20 |  -.8796093   .2319167    -3.79   0.000    -1.334158   -.4250609
 _Icountry_21 |  -.6194315   .1626821    -3.81   0.000    -.9382825   -.3005806
 _Icountry_22 |  -.7527556   .1940977    -3.88   0.000     -1.13318   -.3723311
 _Icountry_23 |    .055751   .0495119     1.13   0.260    -.0412905    .1527926
 _Icountry_24 |  -.5448034   .1848469    -2.95   0.003    -.9070968     -.18251
 _Icountry_25 |  -.3852575    .126768    -3.04   0.002    -.6337182   -.1367969
 _Icountry_26 |  -1.030161   .2159549    -4.77   0.000    -1.453425   -.6068971
 _Icountry_27 |  -.8162726   .2321061    -3.52   0.000    -1.271192   -.3613529
 _Icountry_28 |  -.9030552   .2386534    -3.78   0.000    -1.370807   -.4353032
 _Icountry_29 |   -.717785   .1895446    -3.79   0.000    -1.089286   -.3462844
 _Icountry_30 |  -.8318673   .0477067   -17.44   0.000    -.9253708   -.7383639
 _Icountry_31 |  -.8490545   .2479735    -3.42   0.001    -1.335074   -.3630353
 _Icountry_32 |  -.7460622     .23491    -3.18   0.001    -1.206477    -.285647
 _Icountry_33 |  -.2607594   .0742156    -3.51   0.000    -.4062194   -.1152995
 _Icountry_34 |  -.2477788   .0864077    -2.87   0.004    -.4171348   -.0784228
 _Icountry_35 |  -.6335513   .2142495    -2.96   0.003    -1.053473   -.2136301
 _Icountry_36 |  -.8563017   .2247828    -3.81   0.000    -1.296868   -.4157356
 _Icountry_37 |  -.3690958   .1802895    -2.05   0.041    -.7224568   -.0157349
 _Icountry_38 |  -.9067777   .2350439    -3.86   0.000    -1.367455   -.4461003
 _Icountry_39 |  -.8844848      .2466    -3.59   0.000    -1.367812   -.4011576
 _Icountry_40 |  -.9131155   .2482624    -3.68   0.000    -1.399701   -.4265301
 _Icountry_41 |  -.8544499   .1935998    -4.41   0.000    -1.233899   -.4750012
 _Icountry_42 |   .3485548   .0465537     7.49   0.000     .2573112    .4397985
 _Icountry_43 |  -.1345138   .1229432    -1.09   0.274    -.3754781    .1064505
 _Icountry_44 |   .2405884     .05612     4.29   0.000     .1305953    .3505816
 _Icountry_45 |  -.8318759   .2050179    -4.06   0.000    -1.233704   -.4300482
 _Icountry_46 |  -.8692803   .2291224    -3.79   0.000    -1.318352   -.4202086
 _Icountry_47 |  -.7191218    .242461    -2.97   0.003    -1.194337    -.243907
       attack |   .0224201   .0388697     0.58   0.564    -.0537631    .0986032
    persparty |  -.1192456   .0795368    -1.50   0.134    -.2751348    .0366436
          pXa |   .0665836   .0611505     1.09   0.276    -.0532691    .1864363
           ld |  -.0179876   .0259498    -0.69   0.488    -.0688482     .032873
        ivdem |   2.129065    .598569     3.56   0.000     .9558915    3.302239
         ijud |   .2879796   .1293527     2.23   0.026     .0344529    .5415063
   leftselfid |    .152159   .0080932    18.80   0.000     .1362966    .1680213
  rightselfid |   .1476921   .0084271    17.53   0.000     .1311754    .1642088
          age |   .0014771   .0001494     9.89   0.000     .0011843    .0017699
       female |   .0081239   .0037571     2.16   0.031     .0007602    .0154876
      married |   .0008057   .0034439     0.23   0.815    -.0059441    .0075556
     employed |   -.009356   .0042278    -2.21   0.027    -.0176424   -.0010696
        union |  -.0115624   .0036725    -3.15   0.002    -.0187604   -.0043645
   _Iincome_1 |  -.0053893   .0036057    -1.49   0.135    -.0124564    .0016778
   _Iincome_9 |    .012367   .0076585     1.61   0.106    -.0026434    .0273773
    _Iurban_1 |   .0010239   .0049642     0.21   0.837    -.0087059    .0107536
    _Iurban_8 |  -.1123693   .0469395    -2.39   0.017     -.204369   -.0203696
    _Iurban_9 |   .0139712   .0211212     0.66   0.508    -.0274256    .0553681
_Ieducation_1 |  -.0189988   .0057654    -3.30   0.001    -.0302986   -.0076989
_Ieducation_2 |   -.032796   .0057705    -5.68   0.000     -.044106    -.021486
_Ieducation_9 |  -.0246274   .0206506    -1.19   0.233    -.0651019    .0158471
        _cons |   -1.39339   .2916498    -4.78   0.000    -1.965013   -.8217673
-------------------------------------------------------------------------------

.                  centile persparty if e(sample)==1,centile(10 90)

                                                          Binom. interp.   
    Variable |       Obs  Percentile    Centile        [95% conf. interval]
-------------+-------------------------------------------------------------
   persparty |   133,457         10    .1619093        .1619093    .1619093
             |                   90    .7023838        .7023838    .7023838

.                  lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0224201   .0388697     0.58   0.564    -.0537631    .0986032
------------------------------------------------------------------------------

.                  lincom pXa

 ( 1)  [x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0665836   .0611505     1.09   0.276    -.0532691    .1864363
------------------------------------------------------------------------------

.                  lincom attack + pXa*(.16)

 ( 1)  [x1polar]attack + .16*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0330734   .0333117     0.99   0.321    -.0322163    .0983632
------------------------------------------------------------------------------

.                  lincom attack + pXa*(.70)

 ( 1)  [x1polar]attack + .7*[x1polar]pXa = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0690286   .0341931     2.02   0.044     .0020114    .1360458
------------------------------------------------------------------------------

.  
.         * Among personalist and nonpersonalist voters *
.         xi:mixed x1polar attack persparty pers $cvar $dvar || surveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  57016.044  
Iteration 1:  Log likelihood =  57016.044  

Computing standard errors ...

Mixed-effects ML regression                         Number of obs    = 124,483
Group variable: surveyid                            Number of groups =     120
                                                    Obs per group:
                                                                 min =      92
                                                                 avg = 1,037.4
                                                                 max =   3,582
                                                    Wald chi2(21)    = 4569.89
Log likelihood =  57016.044                         Prob > chi2      =  0.0000

-------------------------------------------------------------------------------
      x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |   .0228288     .01091     2.09   0.036     .0014455    .0442121
    persparty |  -.0397677    .031404    -1.27   0.205    -.1013184    .0217831
         pers |   .0197994   .0016416    12.06   0.000      .016582    .0230169
           ld |  -.0147512   .0073369    -2.01   0.044    -.0291313   -.0003711
        ivdem |   -.002299   .0953858    -0.02   0.981    -.1892518    .1846538
         ijud |   .1237071   .0720865     1.72   0.086    -.0175798    .2649939
   leftselfid |   .0569958   .0011982    47.57   0.000     .0546474    .0593442
  rightselfid |   .0519755   .0010435    49.81   0.000     .0499303    .0540206
          age |    .000527   .0000293    17.98   0.000     .0004696    .0005845
       female |   .0027136   .0008891     3.05   0.002     .0009709    .0044563
      married |  -.0002353    .000965    -0.24   0.807    -.0021267    .0016561
     employed |  -.0042949   .0010558    -4.07   0.000    -.0063643   -.0022256
        union |  -.0031026   .0011172    -2.78   0.005    -.0052923   -.0009128
   _Iincome_1 |  -.0012738   .0010589    -1.20   0.229    -.0033492    .0008015
   _Iincome_9 |   .0041127   .0013702     3.00   0.003     .0014272    .0067981
    _Iurban_1 |   -.000014   .0010326    -0.01   0.989    -.0020377    .0020098
    _Iurban_8 |    -.01726   .0206357    -0.84   0.403    -.0577052    .0231852
    _Iurban_9 |   .0116827   .0051907     2.25   0.024     .0015091    .0218562
_Ieducation_1 |  -.0080704   .0012168    -6.63   0.000    -.0104553   -.0056855
_Ieducation_2 |  -.0134133   .0012363   -10.85   0.000    -.0158364   -.0109902
_Ieducation_9 |  -.0123475    .004063    -3.04   0.002    -.0203109   -.0043841
        _cons |   .5025277   .0641788     7.83   0.000     .3767395    .6283159
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0029455   .0003875       .002276    .0038119
-----------------------------+------------------------------------------------
               var(Residual) |   .0233187   .0000935      .0231362    .0235027
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 9480.72       Prob >= chibar2 = 0.0000

.         qui xi:mixed x1polar attack persparty $cvar $dvar if pers==0 || surveyid:

.                 lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0206267   .0111262     1.85   0.064    -.0011802    .0424337
------------------------------------------------------------------------------

.         qui xi:mixed x1polar C.attack##C.persparty $cvar $dvar if pers==0|| surve
> yid:

.                 lincom c.attack#c.persparty

 ( 1)  [x1polar]c.attack#c.persparty = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1360631   .0396666     3.43   0.001      .058318    .2138081
------------------------------------------------------------------------------

.                 lincom attack + c.attack#c.persparty *.18

 ( 1)  [x1polar]attack + .18*[x1polar]c.attack#c.persparty = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0288881   .0178963    -1.61   0.106    -.0639641    .0061879
------------------------------------------------------------------------------

.                 lincom attack + c.attack#c.persparty *.70

 ( 1)  [x1polar]attack + .7*[x1polar]c.attack#c.persparty = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0418647   .0122448     3.42   0.001     .0178654     .065864
------------------------------------------------------------------------------

.         qui xi:mixed x1polar attack persparty $cvar $dvar if pers==1 || surveyid:

.                 lincom attack

 ( 1)  [x1polar]attack = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0509499   .0201721     2.53   0.012     .0114132    .0904866
------------------------------------------------------------------------------

.         qui xi:mixed x1polar C.attack##C.persparty $cvar $dvar if pers==1 || surv
> eyid:

.                 lincom c.attack#c.persparty

 ( 1)  [x1polar]c.attack#c.persparty = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1260302    .092682     1.36   0.174    -.0556232    .3076835
------------------------------------------------------------------------------

.                 lincom attack + c.attack#c.persparty *.18

 ( 1)  [x1polar]attack + .18*[x1polar]c.attack#c.persparty = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0005806   .0427858    -0.01   0.989    -.0844392    .0832781
------------------------------------------------------------------------------

.                 lincom attack + c.attack#c.persparty *.70

 ( 1)  [x1polar]attack + .7*[x1polar]c.attack#c.persparty = 0

------------------------------------------------------------------------------
     x1polar | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0649551   .0223921     2.90   0.004     .0210674    .1088428
------------------------------------------------------------------------------

.                 
.                         drop b

.                         gen b=.
(136,439 missing values generated)

.                         gen hi=.
(136,439 missing values generated)

.                         gen lo=.
(136,439 missing values generated)

.                         gen n=_n

.                         gen xd = .
(136,439 missing values generated)

.                 xi:interflex x1polar attack persparty $cvar $dvar if pers==0,clus
> ter(surveyid)type(kernel)bw(.2)
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

.                 mat list r(margeff)

r(margeff)[50,5]
         xlevel        marg          se        CI_l        CI_u
 r1           0  -.00332348   .02521322  -.05274048   .04609352
 r2   .01817666  -.00433193   .02465287  -.05265066   .04398681
 r3   .03635333  -.00536776   .02408655  -.05257654   .04184101
 r4   .05452999   -.0063781   .02350587  -.05244876   .03969257
 r5   .07270666  -.00731309    .0229061  -.05220822   .03758205
 r6   .09088332  -.00812758   .02228635  -.05180802   .03555285
 r7   .10905998  -.00878266   .02164928  -.05121447   .03364915
 r8   .12723665  -.00924682   .02100038   -.0504068   .03191317
 r9   .14541331  -.00949684   .02034684  -.04937591   .03038224
r10   .16358998  -.00951795   .01969635  -.04812208   .02908619
r11   .18176664  -.00930355   .01905595  -.04665252   .02804542
r12    .1999433  -.00885427   .01843123  -.04497882   .02727028
r13   .21811997  -.00817664     .017826  -.04311495   .02676168
r14   .23629663  -.00728151   .01724232  -.04107583    .0265128
r15   .25447329  -.00618242   .01668099  -.03887657   .02651172
r16   .27264996  -.00489409   .01614223  -.03653228   .02674409
r17   .29082662  -.00343119   .01562629  -.03405816   .02719577
r18   .30900329  -.00180755   .01513405  -.03146973   .02785464
r19   .32717995  -.00003566   .01466727  -.02878297   .02871165
r20   .34535661    .0018733    .0142286  -.02601424   .02976084
r21   .36353328    .0039093   .01382124  -.02317984   .03099844
r22   .38170994   .00606294   .01344841  -.02029546   .03242134
r23   .39988661   .00832502   .01311265   -.0173753   .03402533
r24   .41806327   .01068597    .0128152  -.01443137   .03580331
r25   .43623993   .01313558   .01255564  -.01147303   .03774418
r26    .4544166   .01566275   .01233172  -.00850698   .03983247
r27   .47259326   .01825563   .01213971  -.00553776   .04204903
r28   .49076993   .02090194   .01197499  -.00256862   .04437249
r29   .50894659    .0235894   .01183286   .00039742   .04678137
r30   .52712325   .02630646   .01170932   .00335661   .04925631
r31   .54529992   .02904298    .0116018   .00630387   .05178209
r32   .56347658   .03179092   .01150957   .00923257   .05434926
r33   .58165324   .03454497   .01143397    .0121348   .05695515
r34   .59982991   .03730305   .01137839   .01500181   .05960429
r35   .61800657   .04006665   .01134808   .01782482   .06230848
r36   .63618324   .04284107   .01134991   .02059565   .06508649
r37    .6543599   .04563554   .01139213   .02330737   .06796371
r38   .67253656   .04846332   .01148418   .02595473    .0709719
r39   .69071323   .05134162   .01163666   .02853418   .07414906
r40   .70888989   .05429163   .01186153   .03104347   .07753979
r41   .72706656   .05733837   .01217253   .03348066   .08119609
r42   .74524322   .06051051   .01258598   .03584245   .08517857
r43   .76341988   .06383999   .01312163   .03812207   .08955791
r44   .78159655   .06736158   .01380353   .04030716   .09441601
r45   .79977321   .07111212   .01466045   .04237817   .09984606
r46   .81794988    .0751296   .01572558   .04430803   .10595116
r47   .83612654   .07945202   .01703546   .04606314    .1128409
r48    .8543032   .08411606    .0186282   .04760545   .12062666
r49   .87247987   .08915552   .02054161    .0488947   .12941635
r50   .89065653   .09459975   .02281168   .04988968   .13930982

.                 forval i = 1/50 {
  2.                         qui replace xd = r(margeff)[`i',1] if n==`i'
  3.                         qui replace b = r(margeff)[`i',2] if n==`i'
  4.                         qui replace lo = r(margeff)[`i',4] if n==`i'
  5.                         qui replace hi = r(margeff)[`i',5] if n==`i'
  6.                 }

.                 twoway (rspike lo hi xd) (scatter b xd,yline(0,lcol(red)lpat(soli
> d))legend(off)saving(h1.gph,replace)ylab(-.1(.05).15) ///
>                         xtit(Ruling party personalism)ytit(Marginal effect of att
> ack)tit(Established party voters)yscale(range(-.12 .164)))
file h1.gph saved

.                 xi:interflex x1polar attack persparty $cvar $dvar if pers==1,clus
> ter(surveyid)type(kernel)bw(.2)
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

.                 mat list r(margeff)     

r(margeff)[50,5]
         xlevel        marg          se        CI_l        CI_u
 r1    .1619093  -.04538692   .03497266  -.11393208   .02315823
 r2   .17678169  -.04089926   .03295776  -.10549527   .02369676
 r3   .19165408  -.03641597   .03102191   -.0972178   .02438585
 r4   .20652647  -.03195798   .02915637  -.08910342   .02518745
 r5   .22139887  -.02754152   .02735481  -.08115596   .02607292
 r6   .23627126  -.02317918   .02561333  -.07338039   .02702203
 r7   .25114365  -.01888093   .02393052  -.06578388   .02802202
 r8   .26601604  -.01465491   .02230729  -.05837639   .02906658
 r9   .28088844  -.01050798   .02074681  -.05117098   .03015502
r10   .29576083  -.00644616   .01925422  -.04418374   .03129141
r11   .31063322  -.00247485   .01783634  -.03743343   .03248373
r12   .32550561   .00140116   .01650127  -.03094072   .03374305
r13   .34037801   .00517773   .01525784  -.02472709   .03508254
r14    .3552504    .0088515   .01411496  -.01881332   .03651632
r15   .37012279   .01242014   .01308079  -.01321774   .03805802
r16   .38499518   .01588247   .01216176  -.00795414   .03971909
r17   .39986758   .01923864   .01136163  -.00302974   .04150701
r18   .41473997   .02249014   .01068061   .00155653   .04342375
r19   .42961236   .02563983   .01011491   .00581496   .04546469
r20   .44448476   .02869174    .0096568   .00976476   .04761871
r21   .45935715    .0316509   .00929529   .01343246   .04986933
r22   .47422954     .034523   .00901738   .01684926   .05219674
r23   .48910193   .03731411   .00880943   .02004794   .05458027
r24   .50397433   .04003027   .00865848   .02305997   .05700058
r25   .51884672   .04267727   .00855317   .02591337   .05944118
r26   .53371911    .0452603   .00848424    .0286315    .0618891
r27    .5485915   .04778383   .00844464   .03123263   .06433502
r28    .5634639   .05025147   .00842946   .03373002   .06677291
r29   .57833629     .052666   .00843573   .03613228   .06919972
r30   .59320868   .05502945   .00846235   .03844355   .07161536
r31   .60808107   .05734327   .00851026   .04066346   .07402307
r32   .62295347   .05960853   .00858272   .04278671   .07643035
r33   .63782586   .06182628   .00868593   .04480217    .0788504
r34   .65269825   .06399783   .00882978   .04669178   .08130387
r35   .66757064   .06612507   .00902857    .0484294   .08382073
r36   .68244304   .06821081   .00930158   .04998006   .08644157
r37   .69731543   .07025907   .00967301   .05130031   .08921783
r38   .71218782   .07227527   .01017112   .05234024    .0922103
r39   .72706021   .07426639   .01082632   .05304719   .09548559
r40   .74193261   .07624105   .01166867   .05337088   .09911122
r41     .756805   .07820942   .01272518   .05326852   .10315032
r42   .77167739   .08018312   .01401783   .05270867   .10765757
r43   .78654978   .08217489   .01556252    .0516729   .11267688
r44   .80142218   .08419826   .01736907   .05015551   .11824102
r45   .81629457   .08626705   .01944178   .04816186   .12437225
r46   .83116696   .08839479   .02178029   .04570622   .13108337
r47   .84603935   .09059405   .02438025   .04280964   .13837847
r48   .86091175   .09287576   .02723402   .03949805   .14625346
r49   .87578414    .0952484   .03033108   .03580057   .15469623
r50   .89065653   .09771726   .03365846   .03174789   .16368662

.                 forval i = 1/50 {
  2.                         qui replace xd = r(margeff)[`i',1] if n==`i'
  3.                         qui replace b = r(margeff)[`i',2] if n==`i'
  4.                         qui replace lo = r(margeff)[`i',4] if n==`i'
  5.                         qui replace hi = r(margeff)[`i',5] if n==`i'
  6.                 }

.                 twoway (rspike lo hi xd) (scatter b xd,yline(0,lcol(red)lpat(soli
> d))legend(off)saving(h2.gph,replace)ylab(-.1(.05).15) ///
>                         xtit(Ruling party personalism)ytit(Marginal effect of att
> ack)tit(Personalist party voters)yscale(range(-.12 .164)))
file h2.gph saved

.                 erase .pdf

.                 gr combine h1.gph h2.gph,xsize(8)tit(Attacks on the judiciary inc
> rease polarization among all voters)

.                 erase h1.gph

.                 erase h2.gph

.                 drop hi lo n b xd

.                 gr export "$dir\golden\T-Attack-Micro-Polarization-voter.pdf",as(
> pdf)replace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\T
    > -Attack-Micro-Polarization-voter.pdf saved as PDF format

.                 
.                 
.                 
.         * Look at Support for Democracy as best form of government *
.                         * Support for democracy *
.                         recode B3015 (5 7 8 9=.),gen(demsupport)
(1,555 differences between B3015 and demsupport)

.                         replace demsupport = (demsupport-1)/3
variable demsupport was byte now float
(27,794 real changes made)

.                         replace demsupport = demsupport*-1  + 1
(27,794 real changes made)

.                         tab B3015 demsupport, m

DEMOCRACY BETTER THAN | RECODE of B3015 (DEMOCRACY BETTER THAN ANY
    ANY OTHER FORM OF |          OTHER FORM OF GOVERNMENT)
           GOVERNMENT |         0   .3333333   .6666666          1 |     Total
----------------------+--------------------------------------------+----------
    1. AGREE STRONGLY |         0          0          0     12,596 |    12,596 
             2. AGREE |         0          0     12,846          0 |    12,846 
          3. DISAGREE |         0      1,871          0          0 |     1,871 
 4. DISAGREE STRONGLY |       481          0          0          0 |       481 
5. [SEE VARIABLE NOTE |         0          0          0          0 |       176 
           7. REFUSED |         0          0          0          0 |        47 
        8. DON'T KNOW |         0          0          0          0 |     1,115 
           9. MISSING |         0          0          0          0 |       217 
                    . |         0          0          0          0 |   107,090 
----------------------+--------------------------------------------+----------
                Total |       481      1,871     12,846     12,596 |   136,439 


                      | RECODE of
                      |   B3015
                      | (DEMOCRACY
                      |   BETTER
                      |  THAN ANY
                      | OTHER FORM
                      |     OF
DEMOCRACY BETTER THAN | GOVERNMENT
    ANY OTHER FORM OF |     )
           GOVERNMENT |         . |     Total
----------------------+-----------+----------
    1. AGREE STRONGLY |         0 |    12,596 
             2. AGREE |         0 |    12,846 
          3. DISAGREE |         0 |     1,871 
 4. DISAGREE STRONGLY |         0 |       481 
5. [SEE VARIABLE NOTE |       176 |       176 
           7. REFUSED |        47 |        47 
        8. DON'T KNOW |     1,115 |     1,115 
           9. MISSING |       217 |       217 
                    . |   107,090 |   107,090 
----------------------+-----------+----------
                Total |   108,645 |   136,439 

.                         table demsupport, stat(n pers) stat(mean pers) stat(n pop
> )  stat(mean pop)

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                     |              Number of nonmissing values                                      Mean                        
                                                                     |  "Personalist   " "party voter{sub:i,c,y}"      pop   "Personalist   " "party voter{sub:i,c,y}"        pop
---------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------
RECODE of B3015 (DEMOCRACY BETTER THAN ANY OTHER FORM OF GOVERNMENT) |                                                                                                           
  0                                                                  |                                        449      449                                     .298441   .3148358
  .3333333                                                           |                                      1,824    1,825                                    .2538377   .3013036
  .6666666                                                           |                                     12,333   12,341                                    .1628963    .272543
  1                                                                  |                                     11,974   11,983                                     .128445   .2410113
  Total                                                              |                                     26,580   26,598                                    .1559067   .2610246
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

.                         
.           xi:mixed demsupport attack $cvar $dvar   || surveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  3339.7619  
Iteration 1:  Log likelihood =  3339.7619  

Computing standard errors ...

Mixed-effects ML regression                          Number of obs    = 27,589
Group variable: surveyid                             Number of groups =     31
                                                     Obs per group:
                                                                  min =    149
                                                                  avg =  890.0
                                                                  max =  1,799
                                                     Wald chi2(19)    = 873.89
Log likelihood =  3339.7619                          Prob > chi2      = 0.0000

-------------------------------------------------------------------------------
   demsupport | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
       attack |  -.0316447   .0189189    -1.67   0.094    -.0687251    .0054356
           ld |   .0411173   .0090886     4.52   0.000     .0233039    .0589306
        ivdem |  -.1095865   .1259002    -0.87   0.384    -.3563462    .1371733
         ijud |   .0335276    .092307     0.36   0.716    -.1473907     .214446
   leftselfid |   .0070147   .0033408     2.10   0.036     .0004669    .0135625
  rightselfid |   .0197902   .0031161     6.35   0.000     .0136828    .0258976
          age |   .0010258    .000088    11.66   0.000     .0008534    .0011983
       female |  -.0152667   .0026461    -5.77   0.000     -.020453   -.0100804
      married |   .0000891    .002894     0.03   0.975     -.005583    .0057613
     employed |   .0030075   .0031504     0.95   0.340    -.0031672    .0091822
        union |   .0052617   .0032479     1.62   0.105     -.001104    .0116274
   _Iincome_1 |   .0309811   .0031571     9.81   0.000     .0247932     .037169
   _Iincome_9 |   .0135281   .0041548     3.26   0.001     .0053848    .0216715
    _Iurban_1 |    .012075   .0029418     4.10   0.000     .0063092    .0178407
    _Iurban_8 |  -.0462795   .0323036    -1.43   0.152    -.1095933    .0170343
    _Iurban_9 |   .0284302   .0122034     2.33   0.020      .004512    .0523485
_Ieducation_1 |   .0411506   .0034952    11.77   0.000     .0343001     .048001
_Ieducation_2 |   .0663646   .0035858    18.51   0.000     .0593365    .0733928
_Ieducation_9 |   .0483096   .0168987     2.86   0.004     .0151886    .0814305
        _cons |   .6120603   .1151613     5.31   0.000     .3863482    .8377723
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |    .001494   .0003937      .0008913    .0025041
-----------------------------+------------------------------------------------
               var(Residual) |   .0457913   .0003901      .0450331    .0465623
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 823.73        Prob >= chibar2 = 0.0000

.           centile persparty if e(sample),centile(50)

                                                          Binom. interp.   
    Variable |       Obs  Percentile    Centile        [95% conf. interval]
-------------+-------------------------------------------------------------
   persparty |    27,589         50    .4580351        .4580351    .4580351

.           xi:mixed demsupport C.attack##C.pers $cvar $dvar if persparty<.45  || s
> urveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  2200.5363  
Iteration 1:  Log likelihood =  2200.5363  

Computing standard errors ...

Mixed-effects ML regression                          Number of obs    = 11,719
Group variable: surveyid                             Number of groups =     12
                                                     Obs per group:
                                                                  min =    419
                                                                  avg =  976.6
                                                                  max =  1,430
                                                     Wald chi2(21)    = 524.57
Log likelihood =  2200.5363                          Prob > chi2      = 0.0000

---------------------------------------------------------------------------------
     demsupport | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
----------------+----------------------------------------------------------------
         attack |   .0310797   .0343558     0.90   0.366    -.0362564    .0984158
           pers |  -.1281612   .1183324    -1.08   0.279    -.3600885    .1037661
                |
c.attack#c.pers |   .1267571   .1078758     1.18   0.240    -.0846757    .3381898
                |
             ld |  -.0018206   .0260964    -0.07   0.944    -.0529686    .0493274
          ivdem |   .2325899   .7593719     0.31   0.759    -1.255752    1.720932
           ijud |   .5399112    .840945     0.64   0.521    -1.108311    2.188133
     leftselfid |   .0220545   .0049096     4.49   0.000     .0124319     .031677
    rightselfid |   .0243112    .004593     5.29   0.000     .0153092    .0333133
            age |   .0014156    .000127    11.14   0.000     .0011666    .0016647
         female |  -.0164238   .0038416    -4.28   0.000    -.0239532   -.0088944
        married |   .0087287   .0041375     2.11   0.035     .0006194     .016838
       employed |  -.0034512   .0042391    -0.81   0.416    -.0117598    .0048574
          union |    .007412   .0043901     1.69   0.091    -.0011924    .0160164
     _Iincome_1 |   .0290002   .0046369     6.25   0.000     .0199119    .0380884
     _Iincome_9 |   .0062597    .006563     0.95   0.340    -.0066035    .0191228
      _Iurban_1 |   .0156576   .0043847     3.57   0.000     .0070637    .0242514
      _Iurban_8 |  -.0620646   .0333716    -1.86   0.063    -.1274717    .0033426
      _Iurban_9 |    .032541    .018808     1.73   0.084     -.004322    .0694039
  _Ieducation_1 |   .0376659   .0050031     7.53   0.000     .0278599    .0474719
  _Ieducation_2 |   .0653509   .0048191    13.56   0.000     .0559057    .0747961
  _Ieducation_9 |   .0396837   .0186725     2.13   0.034     .0030862    .0762812
          _cons |  -.0433403   .2756615    -0.16   0.875    -.5836269    .4969462
---------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0010693   .0004674      .0004539    .0025189
-----------------------------+------------------------------------------------
               var(Residual) |   .0400854    .000524      .0390715    .0411256
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 163.26        Prob >= chibar2 = 0.0000

.           xi:mixed demsupport C.attack##C.pers $cvar $dvar if persparty>=.45   ||
>  surveyid:
i.income          _Iincome_0-9        (naturally coded; _Iincome_0 omitted)
i.urban           _Iurban_0-9         (naturally coded; _Iurban_0 omitted)
i.education       _Ieducation_0-9     (naturally coded; _Ieducation_0 omitted)

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:  Log likelihood =  1179.5072  
Iteration 1:  Log likelihood =  1179.5072  (backed up)

Computing standard errors ...

Mixed-effects ML regression                          Number of obs    = 14,657
Group variable: surveyid                             Number of groups =     18
                                                     Obs per group:
                                                                  min =    149
                                                                  avg =  814.3
                                                                  max =  1,715
                                                     Wald chi2(21)    = 474.76
Log likelihood =  1179.5072                          Prob > chi2      = 0.0000

---------------------------------------------------------------------------------
     demsupport | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
----------------+----------------------------------------------------------------
         attack |  -.0666495    .021734    -3.07   0.002    -.1092473   -.0240516
           pers |  -.0122849   .0167176    -0.73   0.462    -.0450509     .020481
                |
c.attack#c.pers |  -.0213898   .0105997    -2.02   0.044    -.0421648   -.0006149
                |
             ld |    .043049   .0106926     4.03   0.000     .0220918    .0640061
          ivdem |  -.3902423   .1214414    -3.21   0.001    -.6282631   -.1522216
           ijud |  -.0413618   .0754388    -0.55   0.583     -.189219    .1064955
     leftselfid |  -.0056274   .0047324    -1.19   0.234    -.0149028    .0036479
    rightselfid |   .0155845   .0044193     3.53   0.000     .0069228    .0242461
            age |   .0006482   .0001262     5.14   0.000     .0004008    .0008956
         female |   -.013827   .0037616    -3.68   0.000    -.0211995   -.0064544
        married |  -.0068778   .0041619    -1.65   0.098     -.015035    .0012794
       employed |   .0110283   .0046954     2.35   0.019     .0018255    .0202311
          union |   .0048416   .0049229     0.98   0.325    -.0048071    .0144903
     _Iincome_1 |    .026735   .0044942     5.95   0.000     .0179266    .0355435
     _Iincome_9 |   .0142992    .005529     2.59   0.010     .0034626    .0251358
      _Iurban_1 |   .0089089   .0041354     2.15   0.031     .0008038     .017014
      _Iurban_8 |   .1275992   .1288734     0.99   0.322    -.1249881    .3801865
      _Iurban_9 |   .0278885   .0160655     1.74   0.083    -.0035992    .0593763
  _Ieducation_1 |   .0407622   .0050106     8.14   0.000     .0309415    .0505829
  _Ieducation_2 |    .067722   .0054938    12.33   0.000     .0569542    .0784897
  _Ieducation_9 |   .0697781   .0350647     1.99   0.047     .0010525    .1385037
          _cons |   .9824899   .1314146     7.48   0.000      .724922    1.240058
---------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
surveyid: Identity           |
                  var(_cons) |   .0008537   .0003156      .0004137    .0017618
-----------------------------+------------------------------------------------
               var(Residual) |   .0496901   .0005808      .0485647    .0508416
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 214.64        Prob >= chibar2 = 0.0000

.                         global dvar="leftself rightself age female married employ
> ed union i.income i.urban i.education"

.                         global d = "attack"

.                         gen beta=.
(136,439 missing values generated)

.                         gen hi=.
(136,439 missing values generated)

.                         gen lo=.
(136,439 missing values generated)

.                         gen v=""
(136,439 missing values generated)

.                         gen n=_n

.                         capture program drop myplot

.                         program define myplot
  1.                                 local var = "attack _Iincome_1 _Ieducation_2"
  2.                                 local i=1
  3.                                 foreach v of local var {
  4.                                         margins,dydx(`v')
  5.                                         local b =r(table)[1,1] 
  6.                                         local l =r(table)[5,1] 
  7.                                         local u =r(table)[6,1] 
  8.                                         replace beta=`b' if n==`i' + $r
  9.                                         replace lo=`l' if n==`i' + $r
 10.                                         replace hi=`u' if n==`i' + $r
 11.                                         replace v="`v'" if n==`i' + $r
 12.                                         local i=`i'+1
 13.                                 }
 14. 
.                         end

.                         centile persparty if demsupport~=.,centile(50)

                                                          Binom. interp.   
    Variable |       Obs  Percentile    Centile        [95% conf. interval]
-------------+-------------------------------------------------------------
   persparty |    27,794         50    .4580351        .4580351    .4580351

.                         global cut1 = r(c_1)

.                         qui xi:mixed demsupport $d $cvar $dvar if persparty<$cut1
>  || surveyid:

.                                 global r=0

.                                 myplot

Average marginal effects                                Number of obs = 12,675

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  attack

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
      attack |   .0374244   .0326628     1.15   0.252    -.0265935    .1014423
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
variable v was str1 now str6
(1 real change made)

Average marginal effects                                Number of obs = 12,675

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  _Iincome_1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
  _Iincome_1 |   .0331477   .0044563     7.44   0.000     .0244135    .0418819
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
variable v was str6 now str10
(1 real change made)

Average marginal effects                                Number of obs = 12,675

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  _Ieducation_2

-------------------------------------------------------------------------------
              |            Delta-method
              |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
_Ieducation_2 |   .0631892   .0046737    13.52   0.000     .0540288    .0723496
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
variable v was str10 now str13
(1 real change made)

.                         qui xi:mixed demsupport $d $cvar $dvar if persparty>=$cut
> 1 || surveyid:

.                                 global r=5

.                                 myplot

Average marginal effects                                Number of obs = 14,914

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  attack

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
      attack |  -.0813373   .0223333    -3.64   0.000    -.1251098   -.0375647
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)

Average marginal effects                                Number of obs = 14,914

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  _Iincome_1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
  _Iincome_1 |   .0282767   .0044492     6.36   0.000     .0195565    .0369969
------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)

Average marginal effects                                Number of obs = 14,914

Expression: Linear prediction, fixed portion, predict()
dy/dx wrt:  _Ieducation_2

-------------------------------------------------------------------------------
              |            Delta-method
              |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
_Ieducation_2 |   .0709094   .0054419    13.03   0.000     .0602435    .0815753
-------------------------------------------------------------------------------
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)

.                         centile attack if demsupport~=.,centile(10 90) /* moving 
> from low (10pctile) to high (90pctile) attack on judiciary */

                                                          Binom. interp.   
    Variable |       Obs  Percentile    Centile        [95% conf. interval]
-------------+-------------------------------------------------------------
      attack |    27,794         10    .2146966        .2146966    .2146966
             |                   90    1.982842        1.982842    1.982842

.                         gen rb =round(beta,.01)
(136,433 missing values generated)

.                         twoway  (scatter beta n if n==1 | n==6 ,mlab(rb) msym(O)m
> col(gs1)legend(lab(1 "Attack on the state") ///
>                                 lab(3 "High income (low)")lab(5 "High education (
> low)") ///
>                                 order(1 3 5)pos(7)ring(0)))  (rspike hi lo n if n
> ==1 | n==6 ,lcol(gs1)lwidth(thin)) ///
>                                 (scatter beta n if n==2 | n==7 ,mlab(rb) msym(S)m
> col(gs10)yscale(range(-.12 .10)) xlab(2 "Low" 7  "High") ///
>                                 xtit(Ruling party personalism,size(small)) ytit(M
> arginal effect,size(small))ylab(-.12(.06).12) ///
>                                 xscale(range(0.5 8.5))tit(Support for Democracy) 
> )  (rspike hi lo n if n==2 | n==7 ,lcol(gs10)lwidth(thin)yline(0)) ///
>                                 (scatter beta n if n==3 | n==8 ,mlab(rb) msym(T)m
> col(gs10)) (rspike hi lo n if n==3 | n==8 ,lcol(gs10)lwidth(thin))

.                         gr export "$dir\golden\Ch6-Support-Democracy-bins.pdf",as
> (pdf)replace 
file
    C:\Users\jgw12\Dropbox\Research\PersPartyBook\Data\FKTW-reproduction\golden\C
    > h6-Support-Democracy-bins.pdf saved as PDF format

.                         drop n beta hi lo v             

.                         
.         
.         * Compare CSES sample to global sample *
.         egen cytag=tag(country year)

.         keep if cytag==1
(136,315 observations deleted)

.         keep cowcode year country ld ivdem ipolar polarization

.         sort cowcode year

.         merge cowcode year using pers-use
(you are using old merge syntax; see [D] merge for new syntax)
(label pagovsup already defined)
(label paelcont already defined)
(label paallian already defined)
(label oject already defined)
(label storical already defined)
(label regionpol_6C already defined)
(label regionpol already defined)
(label regiongeo already defined)
(label pawomlab_ord already defined)
(label pawelf_ord already defined)
(label paviol_ord already defined)
(label pasoctie_ord already defined)
(label pariglef_ord already defined)
(label parelig_ord already defined)
(label paplur_ord already defined)
(label papeople_ord already defined)
(label papariah_ord already defined)
(label paopresp_ord already defined)
(label panom_ord already defined)
(label paminor_ord already defined)
(label palocoff_ord already defined)
(label palgbt_ord already defined)
(label paind_ord already defined)
(label paimmig_ord already defined)
(label pagender_ord already defined)
(label padisa_ord already defined)
(label paculsup_ord already defined)
(label paclient_ord already defined)
(label paanteli_ord already defined)
(label paactcom_ord already defined)
(label v2regimpgroup_label already defined)
(label v2cacamps_ord_labels already defined)
(label smgovsmcenprc_ord already defined)
(label smgovsmmon_ord already defined)
(label smgovsm_ord already defined)
(label smgovshut_ord already defined)
(label smgovshutcap_ord already defined)
(label smgovsmalt_ord already defined)
(label regsupgroupssize_ord already defined)
(label smpolsoc_ord already defined)
(label smgovfilprc_ord already defined)
(label exl_legitlead_ord already defined)
(label x_regime already defined)
(label elvotbuy_ord already defined)
(label eltvrig already defined)
(label eltvrexo already defined)
(label elsrgel already defined)
(label elsnlsff_ord already defined)
(label elrstrct already defined)
(label elrgstry_ord already defined)
(label elrgpwr_ord already defined)
(label elreggov already defined)
(label elpubfin_ord already defined)
(label elpeace_ord already defined)
(label elpdcamp_ord already defined)
(label elpaidig_ord already defined)
(label elmulpar_ord already defined)
(label ellocpwr_ord already defined)
(label ellocgov already defined)
(label ellocelc already defined)
(label elirreg_ord already defined)
(label elintim_ord already defined)
(label elfrfair_ord already defined)
(label elfrcamp_ord already defined)
(label elffelrbin_ord already defined)
(label elffelr_ord already defined)
(label elembcap_ord already defined)
(label elembaut_ord already defined)
(label eldonate_ord already defined)
(label elboycot_ord already defined)
(label elasmoff_ord already defined)
(label elaccept_ord already defined)

.         tab _merge

     _merge |      Freq.     Percent        Cum.
------------+-----------------------------------
          2 |      2,268       94.82       94.82
          3 |        124        5.18      100.00
------------+-----------------------------------
      Total |      2,392      100.00

.         gen cses_sample =_merge==3

.         ttest gwf_duration,by(cses_sample)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   2,268    32.75044    .7290732    34.72104    31.32072    34.18016
       1 |     124    53.56452    3.796907    42.28057    46.04877    61.08026
---------+--------------------------------------------------------------------
Combined |   2,392    33.82943    .7247113    35.44423     32.4083    35.25056
---------+--------------------------------------------------------------------
    diff |           -20.81408    3.241686               -27.17088   -14.45727
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -6.4208
H0: diff = 0                                     Degrees of freedom =     2390

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

.         ttest ivdem,by(cses_sample)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   2,268    .7068342    .0035517     .169144    .6998693    .7137991
       1 |     124    .8249113    .0094844    .1056139    .8061375    .8436851
---------+--------------------------------------------------------------------
Combined |   2,392    .7129553    .0034448    .1684795    .7062001    .7197104
---------+--------------------------------------------------------------------
    diff |           -.1180771    .0153524               -.1481825   -.0879716
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -7.6911
H0: diff = 0                                     Degrees of freedom =     2390

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

.         ttest persparty,by(cses_sample)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   2,268    .5308832    .0047322    .2253635    .5216033     .540163
       1 |     124    .4334182     .017226    .1918208    .3993204    .4675161
---------+--------------------------------------------------------------------
Combined |   2,392    .5258306    .0045955    .2247548    .5168191    .5348421
---------+--------------------------------------------------------------------
    diff |            .0974649    .0206362                .0569981    .1379317
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   4.7230
H0: diff = 0                                     Degrees of freedom =     2390

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

.                                         ** Attacks on the State **
.                                         gen ojud = l1v2x_jucon if year==min
(1,815 missing values generated)

.                                         egen ijud = max(ojud),by(lid)
(55 missing values generated)

.                                          alpha v2jupurge v2jupoatck v2jupack,item
>  std gen(attack)

Test scale = mean(standardized items)

                                                            Average
                             Item-test     Item-rest       interitem
Item         |  Obs  Sign   correlation   correlation     correlation     alpha
-------------+-----------------------------------------------------------------
v2jupurge    | 2392    +       0.8549        0.6559          0.4472      0.6180
v2jupoatck   | 2392    +       0.8209        0.5895          0.5314      0.6940
v2jupack     | 2392    +       0.7994        0.5497          0.5845      0.7378
-------------+-----------------------------------------------------------------
Test scale   |                                               0.5210      0.7654
-------------------------------------------------------------------------------

.                                          replace attack = attack*-1
(2,392 real changes made)

.                                          qui sum attack

.                                          replace attack = (attack +abs(r(min)))/(
> r(max) + abs(r(min)))
(2,392 real changes made)

.                                          sum attack

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      attack |      2,392    .2656246    .1535195          0          1

.                                          hist attack
(bin=33, start=0, width=.03030303)

.         ttest ld,by(cses_sample)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   2,268    2.985504    .0229092    1.091018    2.940579     3.03043
       1 |     124    3.617741    .0854728    .9517854    3.448552    3.786929
---------+--------------------------------------------------------------------
Combined |   2,392    3.018279    .0223499     1.09309    2.974452    3.062106
---------+--------------------------------------------------------------------
    diff |           -.6322363    .0999985                -.828329   -.4361436
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -6.3225
H0: diff = 0                                     Degrees of freedom =     2390

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

.         ttest ivdem,by(cses_sample)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   2,268    .7068342    .0035517     .169144    .6998693    .7137991
       1 |     124    .8249113    .0094844    .1056139    .8061375    .8436851
---------+--------------------------------------------------------------------
Combined |   2,392    .7129553    .0034448    .1684795    .7062001    .7197104
---------+--------------------------------------------------------------------
    diff |           -.1180771    .0153524               -.1481825   -.0879716
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -7.6911
H0: diff = 0                                     Degrees of freedom =     2390

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

.         ttest ijud,by(cses_sample)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   2,215    .7563512    .0043385    .2041869    .7478433    .7648592
       1 |     122    .8856312    .0114481    .1264481    .8629667    .9082956
---------+--------------------------------------------------------------------
Combined |   2,337    .7631001    .0041972    .2029048    .7548694    .7713308
---------+--------------------------------------------------------------------
    diff |           -.1292799    .0186827               -.1659164   -.0926435
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -6.9198
H0: diff = 0                                     Degrees of freedom =     2335

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

.         ttest attack,by(cses_sample)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   2,268    .2703335     .003221     .153394    .2640172    .2766499
       1 |     124    .1794961    .0115641    .1287726    .1566057    .2023866
---------+--------------------------------------------------------------------
Combined |   2,392    .2656246    .0031389    .1535195    .2594693    .2717799
---------+--------------------------------------------------------------------
    diff |            .0908374    .0140389                .0633078     .118367
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   6.4704
H0: diff = 0                                     Degrees of freedom =     2390

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

.         ttest polarization,by(cses_sample)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   2,241   -.3940919    .0273919    1.296712   -.4478081   -.3403757
       1 |     120   -.8912917    .1280335    1.402536   -1.144811   -.6377726
---------+--------------------------------------------------------------------
Combined |   2,361   -.4193626    .0268893    1.306554   -.4720916   -.3666335
---------+--------------------------------------------------------------------
    diff |            .4971997    .1220205                .2579212    .7364783
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   4.0747
H0: diff = 0                                     Degrees of freedom =     2359

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

.                 
.          ********* The End **********
.          
.          capture log close
